Unverified Commit 7ee910b0 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] ensure --dart-define can parse args with commas (#73798)

parent b2f99e56
...@@ -1028,13 +1028,13 @@ Future<void> _runWebIntegrationTests() async { ...@@ -1028,13 +1028,13 @@ Future<void> _runWebIntegrationTests() async {
await _runWebDebugTest('lib/null_safe_main.dart', enableNullSafety: true); await _runWebDebugTest('lib/null_safe_main.dart', enableNullSafety: true);
await _runWebDebugTest('lib/web_define_loading.dart', await _runWebDebugTest('lib/web_define_loading.dart',
additionalArguments: <String>[ additionalArguments: <String>[
'--dart-define=test.valueA=Example', '--dart-define=test.valueA=Example,A',
'--dart-define=test.valueB=Value', '--dart-define=test.valueB=Value',
] ]
); );
await _runWebReleaseTest('lib/web_define_loading.dart', await _runWebReleaseTest('lib/web_define_loading.dart',
additionalArguments: <String>[ additionalArguments: <String>[
'--dart-define=test.valueA=Example', '--dart-define=test.valueA=Example,A',
'--dart-define=test.valueB=Value', '--dart-define=test.valueB=Value',
] ]
); );
......
...@@ -131,7 +131,7 @@ TaskFunction dartDefinesTask() { ...@@ -131,7 +131,7 @@ TaskFunction dartDefinesTask() {
return DriverTest( return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/ui', '${flutterDirectory.path}/dev/integration_tests/ui',
'lib/defines.dart', extraOptions: <String>[ 'lib/defines.dart', extraOptions: <String>[
'--dart-define=test.valueA=Example', '--dart-define=test.valueA=Example,A',
'--dart-define=test.valueB=Value', '--dart-define=test.valueB=Value',
], ],
); );
......
...@@ -17,6 +17,6 @@ void main() { ...@@ -17,6 +17,6 @@ void main() {
}); });
test('Can run with --dart-define', () async { 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 { ...@@ -8,7 +8,7 @@ Future<void> main() async {
final StringBuffer output = StringBuffer(); final StringBuffer output = StringBuffer();
const String combined = String.fromEnvironment('test.valueA') + const String combined = String.fromEnvironment('test.valueA') +
String.fromEnvironment('test.valueB'); String.fromEnvironment('test.valueB');
if (combined == 'ExampleValue') { if (combined == 'Example,AValue') {
output.write('--- TEST SUCCEEDED ---'); output.write('--- TEST SUCCEEDED ---');
print('--- TEST SUCCEEDED ---'); print('--- TEST SUCCEEDED ---');
} else { } else {
......
...@@ -476,6 +476,7 @@ abstract class FlutterCommand extends Command<void> { ...@@ -476,6 +476,7 @@ abstract class FlutterCommand extends Command<void> {
'and double.fromEnvironment constructors.\n' 'and double.fromEnvironment constructors.\n'
'Multiple defines can be passed by repeating --dart-define multiple times.', 'Multiple defines can be passed by repeating --dart-define multiple times.',
valueHelp: 'foo=bar', valueHelp: 'foo=bar',
splitCommas: false,
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment