mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
[flutter_tools] ensure --dart-define can parse args with commas (#73798)
This commit is contained in:
parent
b2f99e5677
commit
7ee910b0a8
@ -1028,13 +1028,13 @@ Future<void> _runWebIntegrationTests() async {
|
||||
await _runWebDebugTest('lib/null_safe_main.dart', enableNullSafety: true);
|
||||
await _runWebDebugTest('lib/web_define_loading.dart',
|
||||
additionalArguments: <String>[
|
||||
'--dart-define=test.valueA=Example',
|
||||
'--dart-define=test.valueA=Example,A',
|
||||
'--dart-define=test.valueB=Value',
|
||||
]
|
||||
);
|
||||
await _runWebReleaseTest('lib/web_define_loading.dart',
|
||||
additionalArguments: <String>[
|
||||
'--dart-define=test.valueA=Example',
|
||||
'--dart-define=test.valueA=Example,A',
|
||||
'--dart-define=test.valueB=Value',
|
||||
]
|
||||
);
|
||||
|
@ -131,7 +131,7 @@ TaskFunction dartDefinesTask() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'lib/defines.dart', extraOptions: <String>[
|
||||
'--dart-define=test.valueA=Example',
|
||||
'--dart-define=test.valueA=Example,A',
|
||||
'--dart-define=test.valueB=Value',
|
||||
],
|
||||
);
|
||||
|
@ -17,6 +17,6 @@ void main() {
|
||||
});
|
||||
|
||||
test('Can run with --dart-define', () async {
|
||||
await driver.waitFor(find.text('ExampleValue'));
|
||||
await driver.waitFor(find.text('Example,AValue'));
|
||||
});
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ Future<void> main() async {
|
||||
final StringBuffer output = StringBuffer();
|
||||
const String combined = String.fromEnvironment('test.valueA') +
|
||||
String.fromEnvironment('test.valueB');
|
||||
if (combined == 'ExampleValue') {
|
||||
if (combined == 'Example,AValue') {
|
||||
output.write('--- TEST SUCCEEDED ---');
|
||||
print('--- TEST SUCCEEDED ---');
|
||||
} else {
|
||||
|
@ -476,6 +476,7 @@ abstract class FlutterCommand extends Command<void> {
|
||||
'and double.fromEnvironment constructors.\n'
|
||||
'Multiple defines can be passed by repeating --dart-define multiple times.',
|
||||
valueHelp: 'foo=bar',
|
||||
splitCommas: false,
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user