diff --git a/pkg/front_end/tool/update_expectations.dart b/pkg/front_end/tool/update_expectations.dart index bed85ca9dc3..0c0c4489c29 100644 --- a/pkg/front_end/tool/update_expectations.dart +++ b/pkg/front_end/tool/update_expectations.dart @@ -21,22 +21,23 @@ const List specialSuites = [ Future runStandardSuites([List? args]) async { // Assert that 'strong' is the first suite - we use the assumption below. assert(standardSuites.first == 'weak', "Suite 'weak' most be the first."); - bool first = true; + + List testingArguments = []; for (String suite in standardSuites) { List tests = args == null ? [suite] : args.map((String arg) => '${suite}/$arg').toList(); - await fasta.main([ - 'testing', - ...tests, - // Only update comments in the first suite. Note that this only works - // if the first compilation is a full compilation, i.e. not outline, - // because comments are generated during body building and inference. - if (first) '-DupdateComments=true', - '-DupdateExpectations=true' - ]); - first = false; + testingArguments.addAll(tests); } + await fasta.main([ + 'testing', + ...testingArguments, + // Only update comments in the first suite. Note that this only works + // if the first compilation is a full compilation, i.e. not outline, + // because comments are generated during body building and inference. + '-DupdateComments=true', + '-DupdateExpectations=true' + ]); } Future main(List args) async { @@ -61,7 +62,7 @@ Future main(List args) async { } } if (standardTests.isNotEmpty) { - await runStandardSuites(args); + await runStandardSuites(standardTests); } } } diff --git a/pkg/testing/lib/src/chain.dart b/pkg/testing/lib/src/chain.dart index 9e8623fbe1f..631efabe68f 100644 --- a/pkg/testing/lib/src/chain.dart +++ b/pkg/testing/lib/src/chain.dart @@ -72,7 +72,7 @@ class Chain extends Suite { void writeClosureOn(StringSink sink) { sink.write("await runChain("); sink.write(name); - sink.writeln(".createContext, environment, selectors, r'''"); + sink.writeln(".createContext, {...environment}, selectors, r'''"); const String jsonExtraIndent = " "; sink.write(jsonExtraIndent); sink.writeAll(splitLines(JsonEncoder.withIndent(" ").convert(this)),