diff --git a/benchmarks/MultipleReturns/dart/MultipleReturns.dart b/benchmarks/MultipleReturns/dart/MultipleReturns.dart index b289c6085f1..6b9b15cdcfa 100644 --- a/benchmarks/MultipleReturns/dart/MultipleReturns.dart +++ b/benchmarks/MultipleReturns/dart/MultipleReturns.dart @@ -59,15 +59,18 @@ ResultClass forwardedClass() => notInlinedClass(); @pragma('vm:prefer-inline') @pragma('dart2js:prefer-inline') -({int result0, String result1}) inlinedRecordNamed() => (result0: input1, result1: input2); +({int result0, String result1}) inlinedRecordNamed() => + (result0: input1, result1: input2); @pragma('vm:never-inline') @pragma('dart2js:never-inline') -({int result0, String result1}) notInlinedRecordNamed() => (result0: input1, result1: input2); +({int result0, String result1}) notInlinedRecordNamed() => + (result0: input1, result1: input2); @pragma('vm:never-inline') @pragma('dart2js:never-inline') -({int result0, String result1}) forwardedRecordNamed() => notInlinedRecordNamed(); +({int result0, String result1}) forwardedRecordNamed() => + notInlinedRecordNamed(); class BenchInlinedList extends BenchmarkBase { BenchInlinedList() : super('MultipleReturns.Inlined.List'); @@ -165,7 +168,6 @@ class BenchForwardedClass extends BenchmarkBase { } } - class BenchInlinedRecord extends BenchmarkBase { BenchInlinedRecord() : super('MultipleReturns.Inlined.Record'); @@ -231,7 +233,8 @@ class BenchInlinedRecordNamed extends BenchmarkBase { } class BenchNotInlinedRecordNamed extends BenchmarkBase { - BenchNotInlinedRecordNamed() : super('MultipleReturns.NotInlined.RecordNamed'); + BenchNotInlinedRecordNamed() + : super('MultipleReturns.NotInlined.RecordNamed'); @override void run() { diff --git a/benchmarks/RecordCollections/dart/RecordCollections.dart b/benchmarks/RecordCollections/dart/RecordCollections.dart index f32cfaa70c4..1eea5d06f08 100644 --- a/benchmarks/RecordCollections/dart/RecordCollections.dart +++ b/benchmarks/RecordCollections/dart/RecordCollections.dart @@ -18,13 +18,14 @@ class Pair { final int v0; final int v1; const Pair(this.v0, this.v1); - bool operator==(other) => other is Pair && v0 == other.v0 && v1 == other.v1; + bool operator ==(other) => other is Pair && v0 == other.v0 && v1 == other.v1; int get hashCode => Object.hash(v0, v1); } @pragma('vm:never-inline') @pragma('dart2js:never-inline') -List getPolymorphicListOfClass(int length, bool growable, bool withValues) { +List getPolymorphicListOfClass( + int length, bool growable, bool withValues) { if (runtimeTrue) { if (withValues) { return List.generate(length, (i) => Pair(i, i), growable: growable); @@ -38,10 +39,12 @@ List getPolymorphicListOfClass(int length, bool growable, bool withValue @pragma('vm:never-inline') @pragma('dart2js:never-inline') -List getPolymorphicListOfRecords(int length, bool growable, bool withValues) { +List getPolymorphicListOfRecords( + int length, bool growable, bool withValues) { if (runtimeTrue) { if (withValues) { - return List<(int, int)>.generate(length, (i) => (i, i), growable: growable); + return List<(int, int)>.generate(length, (i) => (i, i), + growable: growable); } else { return List<(int, int)>.filled(length, (-1, -1), growable: growable); } @@ -95,7 +98,8 @@ class BenchListAddPolyRecord extends BenchmarkBase { @override void run() { - final List list = getPolymorphicListOfRecords(0, runtimeTrue, false); + final List list = + getPolymorphicListOfRecords(0, runtimeTrue, false); for (int i = 0; i < N; ++i) { list.add((i, i)); } @@ -118,7 +122,8 @@ class BenchListSetIndexedClass extends BenchmarkBase { } class BenchListSetIndexedRecord extends BenchmarkBase { - BenchListSetIndexedRecord() : super('RecordCollections.ListSetIndexed.Record'); + BenchListSetIndexedRecord() + : super('RecordCollections.ListSetIndexed.Record'); @override void run() { @@ -131,7 +136,8 @@ class BenchListSetIndexedRecord extends BenchmarkBase { } class BenchListSetIndexedPolyClass extends BenchmarkBase { - BenchListSetIndexedPolyClass() : super('RecordCollections.ListSetIndexedPoly.Class'); + BenchListSetIndexedPolyClass() + : super('RecordCollections.ListSetIndexedPoly.Class'); @override void run() { @@ -145,11 +151,13 @@ class BenchListSetIndexedPolyClass extends BenchmarkBase { } class BenchListSetIndexedPolyRecord extends BenchmarkBase { - BenchListSetIndexedPolyRecord() : super('RecordCollections.ListSetIndexedPoly.Record'); + BenchListSetIndexedPolyRecord() + : super('RecordCollections.ListSetIndexedPoly.Record'); @override void run() { - final List list = getPolymorphicListOfRecords(N, !runtimeTrue, false); + final List list = + getPolymorphicListOfRecords(N, !runtimeTrue, false); for (int i = 0; i < N; ++i) { list[i] = (i, i); } @@ -162,8 +170,7 @@ class BenchListGetIndexedClass extends BenchmarkBase { BenchListGetIndexedClass() : super('RecordCollections.ListGetIndexed.Class'); final list = [ - for (int i = 0; i < N; ++i) - Pair(i, i), + for (int i = 0; i < N; ++i) Pair(i, i), ]; @override @@ -177,11 +184,11 @@ class BenchListGetIndexedClass extends BenchmarkBase { } class BenchListGetIndexedRecord extends BenchmarkBase { - BenchListGetIndexedRecord() : super('RecordCollections.ListGetIndexed.Record'); + BenchListGetIndexedRecord() + : super('RecordCollections.ListGetIndexed.Record'); final list = <(int, int)>[ - for (int i = 0; i < N; ++i) - (i, i), + for (int i = 0; i < N; ++i) (i, i), ]; @override @@ -195,7 +202,8 @@ class BenchListGetIndexedRecord extends BenchmarkBase { } class BenchListGetIndexedPolyClass extends BenchmarkBase { - BenchListGetIndexedPolyClass() : super('RecordCollections.ListGetIndexedPoly.Class'); + BenchListGetIndexedPolyClass() + : super('RecordCollections.ListGetIndexedPoly.Class'); final list = getPolymorphicListOfClass(N, runtimeTrue, true) as List; @@ -210,9 +218,11 @@ class BenchListGetIndexedPolyClass extends BenchmarkBase { } class BenchListGetIndexedPolyRecord extends BenchmarkBase { - BenchListGetIndexedPolyRecord() : super('RecordCollections.ListGetIndexedPoly.Record'); + BenchListGetIndexedPolyRecord() + : super('RecordCollections.ListGetIndexedPoly.Record'); - final list = getPolymorphicListOfRecords(N, runtimeTrue, true) as List<(int, int)>; + final list = + getPolymorphicListOfRecords(N, runtimeTrue, true) as List<(int, int)>; @override void run() { @@ -228,8 +238,7 @@ class BenchListIterateClass extends BenchmarkBase { BenchListIterateClass() : super('RecordCollections.ListIterate.Class'); final list = [ - for (int i = 0; i < N; ++i) - Pair(i, i), + for (int i = 0; i < N; ++i) Pair(i, i), ]; @override @@ -246,8 +255,7 @@ class BenchListIterateRecord extends BenchmarkBase { BenchListIterateRecord() : super('RecordCollections.ListIterate.Record'); final list = <(int, int)>[ - for (int i = 0; i < N; ++i) - (i, i), + for (int i = 0; i < N; ++i) (i, i), ]; @override @@ -261,7 +269,8 @@ class BenchListIterateRecord extends BenchmarkBase { } class BenchListIteratePolyClass extends BenchmarkBase { - BenchListIteratePolyClass() : super('RecordCollections.ListIteratePoly.Class'); + BenchListIteratePolyClass() + : super('RecordCollections.ListIteratePoly.Class'); final list = getPolymorphicListOfClass(N, runtimeTrue, true) as List; @@ -276,9 +285,11 @@ class BenchListIteratePolyClass extends BenchmarkBase { } class BenchListIteratePolyRecord extends BenchmarkBase { - BenchListIteratePolyRecord() : super('RecordCollections.ListIteratePoly.Record'); + BenchListIteratePolyRecord() + : super('RecordCollections.ListIteratePoly.Record'); - final list = getPolymorphicListOfRecords(N, runtimeTrue, true) as List<(int, int)>; + final list = + getPolymorphicListOfRecords(N, runtimeTrue, true) as List<(int, int)>; @override void run() { @@ -346,8 +357,7 @@ class BenchMapLookupClass extends BenchmarkBase { BenchMapLookupClass() : super('RecordCollections.MapLookup.Class'); final map = { - for (int i = 0; i < N; ++i) - Pair(i, i): i, + for (int i = 0; i < N; ++i) Pair(i, i): i, }; @override @@ -364,8 +374,7 @@ class BenchMapLookupRecord extends BenchmarkBase { BenchMapLookupRecord() : super('RecordCollections.MapLookup.Record'); final map = <(int, int), int>{ - for (int i = 0; i < N; ++i) - (i, i): i, + for (int i = 0; i < N; ++i) (i, i): i, }; @override @@ -408,8 +417,7 @@ class BenchSetLookupClass extends BenchmarkBase { BenchSetLookupClass() : super('RecordCollections.SetLookup.Class'); final set = { - for (int i = 0; i < N ~/ 2; ++i) - Pair(i * 2, i * 2), + for (int i = 0; i < N ~/ 2; ++i) Pair(i * 2, i * 2), }; @override @@ -426,8 +434,7 @@ class BenchSetLookupRecord extends BenchmarkBase { BenchSetLookupRecord() : super('RecordCollections.SetLookup.Record'); final set = <(int, int)>{ - for (int i = 0; i < N ~/ 2; ++i) - (i * 2, i * 2), + for (int i = 0; i < N ~/ 2; ++i) (i * 2, i * 2), }; @override @@ -449,29 +456,24 @@ void main() { BenchListAddRecord(), BenchListAddPolyClass(), BenchListAddPolyRecord(), - BenchListSetIndexedClass(), BenchListSetIndexedRecord(), BenchListSetIndexedPolyClass(), BenchListSetIndexedPolyRecord(), - BenchListGetIndexedClass(), BenchListGetIndexedRecord(), BenchListGetIndexedPolyClass(), BenchListGetIndexedPolyRecord(), - BenchListIterateClass(), BenchListIterateRecord(), BenchListIteratePolyClass(), BenchListIteratePolyRecord(), - BenchMapAddClassKey(), BenchMapAddRecordKey(), BenchMapAddClassValue(), BenchMapAddRecordValue(), BenchMapLookupClass(), BenchMapLookupRecord(), - BenchSetAddClass(), BenchSetAddRecord(), BenchSetLookupClass(), diff --git a/benchmarks/Utf8Encode/dart/Utf8Encode.dart b/benchmarks/Utf8Encode/dart/Utf8Encode.dart index 3ce85544b4e..5d50bf8a263 100644 --- a/benchmarks/Utf8Encode/dart/Utf8Encode.dart +++ b/benchmarks/Utf8Encode/dart/Utf8Encode.dart @@ -28,7 +28,9 @@ class Utf8Encode extends BenchmarkBase { String name = 'Utf8Encode.$language.'; name += size >= 1000000 ? '${size ~/ 1000000}M' - : size >= 1000 ? '${size ~/ 1000}k' : '$size'; + : size >= 1000 + ? '${size ~/ 1000}k' + : '$size'; return name; } @@ -43,7 +45,8 @@ class Utf8Encode extends BenchmarkBase { final int nChunks = (size < nRunes) ? (nRunes / size).floor() : 1; for (int i = 0; i < nChunks; i++) { final offset = i * size; - benchmarkTextChunks.add(String.fromCharCodes(runes.sublist(offset, offset+size))); + benchmarkTextChunks + .add(String.fromCharCodes(runes.sublist(offset, offset + size))); } } @@ -51,7 +54,7 @@ class Utf8Encode extends BenchmarkBase { void run() { for (int i = 0; i < benchmarkTextChunks.length; i++) { final encoded = utf8.encode(benchmarkTextChunks[i]); - if (encoded.length < benchmarkTextChunks[i].length) { + if (encoded.length < benchmarkTextChunks[i].length) { throw 'There should be at least as many encoded bytes as runes'; } } diff --git a/benchmarks/Utf8Encode/dart2/Utf8Encode.dart b/benchmarks/Utf8Encode/dart2/Utf8Encode.dart index 1d6e35ac042..7bfaffbadbf 100644 --- a/benchmarks/Utf8Encode/dart2/Utf8Encode.dart +++ b/benchmarks/Utf8Encode/dart2/Utf8Encode.dart @@ -30,7 +30,9 @@ class Utf8Encode extends BenchmarkBase { String name = 'Utf8Encode.$language.'; name += size >= 1000000 ? '${size ~/ 1000000}M' - : size >= 1000 ? '${size ~/ 1000}k' : '$size'; + : size >= 1000 + ? '${size ~/ 1000}k' + : '$size'; return name; } @@ -46,7 +48,8 @@ class Utf8Encode extends BenchmarkBase { benchmarkTextChunks = List(nChunks); for (int i = 0; i < nChunks; i++) { final offset = i * size; - benchmarkTextChunks[i] = String.fromCharCodes(runes.sublist(offset, offset+size)); + benchmarkTextChunks[i] = + String.fromCharCodes(runes.sublist(offset, offset + size)); } } @@ -54,7 +57,7 @@ class Utf8Encode extends BenchmarkBase { void run() { for (int i = 0; i < benchmarkTextChunks.length; i++) { final encoded = utf8.encode(benchmarkTextChunks[i]); - if (encoded.length < benchmarkTextChunks[i].length) { + if (encoded.length < benchmarkTextChunks[i].length) { throw 'There should be at least as many encoded bytes as runes'; } } diff --git a/runtime/tests/vm/dart/byte_array_optimized_test.dart b/runtime/tests/vm/dart/byte_array_optimized_test.dart index ca3b43279f6..95fc25c567f 100644 --- a/runtime/tests/vm/dart/byte_array_optimized_test.dart +++ b/runtime/tests/vm/dart/byte_array_optimized_test.dart @@ -83,8 +83,8 @@ class OptimizedByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 0x7F - i; } - Expect - .listEquals([127, 126, 125, 124, 123, 122, 121, 120, 119, 118], array); + Expect.listEquals( + [127, 126, 125, 124, 123, 122, 121, 120, 119, 118], array); for (int i = 0; i < array.length; ++i) { array[i] = -0x80 + i; } @@ -920,8 +920,8 @@ class OptimizedByteArrayTest { Expect.equals(10, array.length); Expect.equals(4, array.elementSizeInBytes); Expect.equals(40, array.lengthInBytes); - Expect - .listEquals([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); + Expect.listEquals( + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); Expect.throws(() { array[-1] = 0.0; }, (e) { @@ -975,8 +975,8 @@ class OptimizedByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); // TODO: min, max, and round for (int i = 0; i < array.length; ++i) { array[i] = i * 1.0; @@ -1022,8 +1022,8 @@ class OptimizedByteArrayTest { Expect.equals(10, array.length); Expect.equals(8, array.elementSizeInBytes); Expect.equals(80, array.lengthInBytes); - Expect - .listEquals([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); + Expect.listEquals( + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); Expect.throws(() { array[-1] = 0.0; }, (e) { @@ -1077,8 +1077,8 @@ class OptimizedByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); // TODO: min, max for (int i = 0; i < array.length; ++i) { array[i] = i * 1.0; @@ -4003,8 +4003,8 @@ class OptimizedByteArrayTest { for (int i = 0; i < view.length; ++i) { view[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); Expect.listEquals([ 0xBF800000, 0x3F800000, @@ -4168,8 +4168,8 @@ class OptimizedByteArrayTest { for (int i = 0; i < view.length; ++i) { view[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); Expect.listEquals([ 0xBFF0000000000000, 0x3FF0000000000000, diff --git a/runtime/tests/vm/dart/byte_array_test.dart b/runtime/tests/vm/dart/byte_array_test.dart index 441681fa035..32385cf07bf 100644 --- a/runtime/tests/vm/dart/byte_array_test.dart +++ b/runtime/tests/vm/dart/byte_array_test.dart @@ -81,8 +81,8 @@ class ByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 0x7F - i; } - Expect - .listEquals([127, 126, 125, 124, 123, 122, 121, 120, 119, 118], array); + Expect.listEquals( + [127, 126, 125, 124, 123, 122, 121, 120, 119, 118], array); for (int i = 0; i < array.length; ++i) { array[i] = -0x80 + i; } @@ -282,8 +282,8 @@ class ByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 0x100 + i; } - Expect - .listEquals([255, 255, 255, 255, 255, 255, 255, 255, 255, 255], array); + Expect.listEquals( + [255, 255, 255, 255, 255, 255, 255, 255, 255, 255], array); for (int i = 0; i < array.length; ++i) { array[i] = 0xFF - i; } @@ -1043,8 +1043,8 @@ class ByteArrayTest { Expect.equals(10, array.length); Expect.equals(4, array.elementSizeInBytes); Expect.equals(40, array.lengthInBytes); - Expect - .listEquals([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); + Expect.listEquals( + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); Expect.throws(() { array[-1] = 0.0; }, (e) { @@ -1098,8 +1098,8 @@ class ByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); // TODO: min, max, and round for (int i = 0; i < array.length; ++i) { array[i] = i * 1.0; @@ -1148,8 +1148,8 @@ class ByteArrayTest { Expect.equals(10, array.length); Expect.equals(8, array.elementSizeInBytes); Expect.equals(80, array.lengthInBytes); - Expect - .listEquals([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); + Expect.listEquals( + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); Expect.throws(() { array[-1] = 0.0; }, (e) { @@ -1203,8 +1203,8 @@ class ByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); // TODO: min, max for (int i = 0; i < array.length; ++i) { array[i] = i * 1.0; @@ -4397,8 +4397,8 @@ class ByteArrayTest { for (int i = 0; i < view.length; ++i) { view[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); Expect.listEquals([ 0xBF800000, 0x3F800000, @@ -4562,8 +4562,8 @@ class ByteArrayTest { for (int i = 0; i < view.length; ++i) { view[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); Expect.listEquals([ 0xBFF0000000000000, 0x3FF0000000000000, diff --git a/runtime/tests/vm/dart/hello_fuchsia_test.dart b/runtime/tests/vm/dart/hello_fuchsia_test.dart index 9b259109a53..ed4e9629902 100644 --- a/runtime/tests/vm/dart/hello_fuchsia_test.dart +++ b/runtime/tests/vm/dart/hello_fuchsia_test.dart @@ -435,7 +435,6 @@ bool testFileOpenDirectoryFails() { return false; } - Future testListInterfaces() async { List interfaces = await NetworkInterface.list(); print('Found ${interfaces.length} interfaces:'); diff --git a/runtime/tests/vm/dart/isolates/test_utils.dart b/runtime/tests/vm/dart/isolates/test_utils.dart index 3268cc18a2e..6044a8b3ad8 100644 --- a/runtime/tests/vm/dart/isolates/test_utils.dart +++ b/runtime/tests/vm/dart/isolates/test_utils.dart @@ -7,7 +7,7 @@ import 'dart:io'; import 'dart:isolate'; export '../../../../../benchmarks/IsolateFibonacci/dart/IsolateFibonacci.dart' - show fibonacciRecursive; + show fibonacciRecursive; final bool isDebugMode = Platform.script.path.contains('Debug'); final bool isSimulator = Platform.script.path.contains('SIM'); diff --git a/runtime/tests/vm/dart/records_allocation_sinking_il_test.dart b/runtime/tests/vm/dart/records_allocation_sinking_il_test.dart index 64f4646475e..0ff310adc89 100644 --- a/runtime/tests/vm/dart/records_allocation_sinking_il_test.dart +++ b/runtime/tests/vm/dart/records_allocation_sinking_il_test.dart @@ -12,7 +12,9 @@ import 'package:vm/testing/il_matchers.dart'; (int, bool) createRecord1(int x, bool y) => (x, y); @pragma('vm:prefer-inline') -({String foo, bool bar, int baz}) createRecord2(String foo, bool bar, int baz) => (foo: foo, bar: bar, baz: baz); +({String foo, bool bar, int baz}) createRecord2( + String foo, bool bar, int baz) => + (foo: foo, bar: bar, baz: baz); @pragma('vm:never-inline') @pragma('vm:testing:print-flow-graph') @@ -52,5 +54,6 @@ void matchIL$test(FlowGraph graph) { void main(List args) { // Make sure all parameters are non-constant. - test(args.length + 5, int.parse('3') == 3, 'foo' + 3.toString(), int.parse('3') == 4, args.length + 7); + test(args.length + 5, int.parse('3') == 3, 'foo' + 3.toString(), + int.parse('3') == 4, args.length + 7); } diff --git a/runtime/tests/vm/dart/records_return_value_unboxing_il_test.dart b/runtime/tests/vm/dart/records_return_value_unboxing_il_test.dart index 59fd80ed726..66305459485 100644 --- a/runtime/tests/vm/dart/records_return_value_unboxing_il_test.dart +++ b/runtime/tests/vm/dart/records_return_value_unboxing_il_test.dart @@ -102,7 +102,6 @@ void matchIL$test(FlowGraph graph) { 'obj1' << match.Parameter(index: 4), 'obj2' << match.Parameter(index: 5), match.CheckStackOverflow(), - match.MoveArgument('x'), match.MoveArgument('z'), 'r1' << match.StaticCall(), @@ -112,7 +111,6 @@ void matchIL$test(FlowGraph graph) { match.StaticCall(), match.MoveArgument('r1_1'), match.StaticCall(), - match.MoveArgument('foo'), match.MoveArgument('bar'), 'r2' << match.StaticCall(), @@ -122,7 +120,6 @@ void matchIL$test(FlowGraph graph) { match.StaticCall(), match.MoveArgument('r2_bar'), match.StaticCall(), - match.MoveArgument('obj1'), 'r3' << match.StaticCall(), 'r3_0' << match.ExtractNthOutput('r3', index: 0), @@ -131,7 +128,6 @@ void matchIL$test(FlowGraph graph) { match.StaticCall(), match.MoveArgument('r3_y'), match.StaticCall(), - 'obj2_cid' << match.LoadClassId('obj2'), match.MoveArgument('obj2'), 'r4' << match.DispatchTableCall('obj2_cid'), @@ -140,7 +136,6 @@ void matchIL$test(FlowGraph graph) { 'r4_boxed' << match.AllocateSmallRecord('r4_0', 'r4_y'), match.MoveArgument('r4_boxed'), match.StaticCall(), - match.Return(), ]), ]); @@ -152,10 +147,6 @@ void main(List args) { final intValue = args.length > 50 ? 1 << 53 : 42; final doubleValue = args.length > 50 ? 42.5 : 24.5; - test(intValue, - intValue == 4, - 'foo' + intValue.toString(), - intValue, - B(intValue, doubleValue), - intValue == 42 ? B(1, 2) : C()); + test(intValue, intValue == 4, 'foo' + intValue.toString(), intValue, + B(intValue, doubleValue), intValue == 42 ? B(1, 2) : C()); } diff --git a/runtime/tests/vm/dart/regress_49372_deferred.dart b/runtime/tests/vm/dart/regress_49372_deferred.dart index f466fe2ebf4..efc93465fa2 100644 --- a/runtime/tests/vm/dart/regress_49372_deferred.dart +++ b/runtime/tests/vm/dart/regress_49372_deferred.dart @@ -9,4 +9,4 @@ int foo() => 10; @pragma('vm:never-inline') -int bar() => foo() + 2; \ No newline at end of file +int bar() => foo() + 2; diff --git a/runtime/tests/vm/dart/regress_51091_test.dart b/runtime/tests/vm/dart/regress_51091_test.dart index 4d7c522da93..92bfb86ac30 100644 --- a/runtime/tests/vm/dart/regress_51091_test.dart +++ b/runtime/tests/vm/dart/regress_51091_test.dart @@ -19,11 +19,9 @@ void test1() { } void test2(int arg) { - switch(arg) { - case == 0 && var x: - Expect.equals(0, x); - case == 1 && var x: - Expect.equals(1, x); + switch (arg) { + case == 0 && var x: Expect.equals(0, x); + case == 1 && var x: Expect.equals(1, x); } var x = 1; Expect.equals(1, x); @@ -33,4 +31,4 @@ void main() { test1(); test2(0); test2(1); -} \ No newline at end of file +} diff --git a/runtime/tests/vm/dart_2/byte_array_optimized_test.dart b/runtime/tests/vm/dart_2/byte_array_optimized_test.dart index 73e5e3d1fc8..e70caf4822b 100644 --- a/runtime/tests/vm/dart_2/byte_array_optimized_test.dart +++ b/runtime/tests/vm/dart_2/byte_array_optimized_test.dart @@ -85,8 +85,8 @@ class OptimizedByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 0x7F - i; } - Expect - .listEquals([127, 126, 125, 124, 123, 122, 121, 120, 119, 118], array); + Expect.listEquals( + [127, 126, 125, 124, 123, 122, 121, 120, 119, 118], array); for (int i = 0; i < array.length; ++i) { array[i] = -0x80 + i; } @@ -922,8 +922,8 @@ class OptimizedByteArrayTest { Expect.equals(10, array.length); Expect.equals(4, array.elementSizeInBytes); Expect.equals(40, array.lengthInBytes); - Expect - .listEquals([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); + Expect.listEquals( + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); Expect.throws(() { array[-1] = 0.0; }, (e) { @@ -977,8 +977,8 @@ class OptimizedByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); // TODO: min, max, and round for (int i = 0; i < array.length; ++i) { array[i] = i * 1.0; @@ -1024,8 +1024,8 @@ class OptimizedByteArrayTest { Expect.equals(10, array.length); Expect.equals(8, array.elementSizeInBytes); Expect.equals(80, array.lengthInBytes); - Expect - .listEquals([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); + Expect.listEquals( + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); Expect.throws(() { array[-1] = 0.0; }, (e) { @@ -1079,8 +1079,8 @@ class OptimizedByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); // TODO: min, max for (int i = 0; i < array.length; ++i) { array[i] = i * 1.0; @@ -4005,8 +4005,8 @@ class OptimizedByteArrayTest { for (int i = 0; i < view.length; ++i) { view[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); Expect.listEquals([ 0xBF800000, 0x3F800000, @@ -4170,8 +4170,8 @@ class OptimizedByteArrayTest { for (int i = 0; i < view.length; ++i) { view[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); Expect.listEquals([ 0xBFF0000000000000, 0x3FF0000000000000, diff --git a/runtime/tests/vm/dart_2/byte_array_test.dart b/runtime/tests/vm/dart_2/byte_array_test.dart index d1f7eb9205f..a3f9e666984 100644 --- a/runtime/tests/vm/dart_2/byte_array_test.dart +++ b/runtime/tests/vm/dart_2/byte_array_test.dart @@ -83,8 +83,8 @@ class ByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 0x7F - i; } - Expect - .listEquals([127, 126, 125, 124, 123, 122, 121, 120, 119, 118], array); + Expect.listEquals( + [127, 126, 125, 124, 123, 122, 121, 120, 119, 118], array); for (int i = 0; i < array.length; ++i) { array[i] = -0x80 + i; } @@ -284,8 +284,8 @@ class ByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 0x100 + i; } - Expect - .listEquals([255, 255, 255, 255, 255, 255, 255, 255, 255, 255], array); + Expect.listEquals( + [255, 255, 255, 255, 255, 255, 255, 255, 255, 255], array); for (int i = 0; i < array.length; ++i) { array[i] = 0xFF - i; } @@ -1045,8 +1045,8 @@ class ByteArrayTest { Expect.equals(10, array.length); Expect.equals(4, array.elementSizeInBytes); Expect.equals(40, array.lengthInBytes); - Expect - .listEquals([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); + Expect.listEquals( + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); Expect.throws(() { array[-1] = 0.0; }, (e) { @@ -1100,8 +1100,8 @@ class ByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); // TODO: min, max, and round for (int i = 0; i < array.length; ++i) { array[i] = i * 1.0; @@ -1150,8 +1150,8 @@ class ByteArrayTest { Expect.equals(10, array.length); Expect.equals(8, array.elementSizeInBytes); Expect.equals(80, array.lengthInBytes); - Expect - .listEquals([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); + Expect.listEquals( + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], array); Expect.throws(() { array[-1] = 0.0; }, (e) { @@ -1205,8 +1205,8 @@ class ByteArrayTest { for (int i = 0; i < array.length; ++i) { array[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], array); // TODO: min, max for (int i = 0; i < array.length; ++i) { array[i] = i * 1.0; @@ -4399,8 +4399,8 @@ class ByteArrayTest { for (int i = 0; i < view.length; ++i) { view[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); Expect.listEquals([ 0xBF800000, 0x3F800000, @@ -4564,8 +4564,8 @@ class ByteArrayTest { for (int i = 0; i < view.length; ++i) { view[i] = 1.0 + i; } - Expect - .listEquals([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); + Expect.listEquals( + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], view); Expect.listEquals([ 0xBFF0000000000000, 0x3FF0000000000000, diff --git a/runtime/tests/vm/dart_2/hello_fuchsia_test.dart b/runtime/tests/vm/dart_2/hello_fuchsia_test.dart index 2b75891fa6c..dab593c87fc 100644 --- a/runtime/tests/vm/dart_2/hello_fuchsia_test.dart +++ b/runtime/tests/vm/dart_2/hello_fuchsia_test.dart @@ -437,7 +437,6 @@ bool testFileOpenDirectoryFails() { } } - Future testListInterfaces() async { List interfaces = await NetworkInterface.list(); print('Found ${interfaces.length} interfaces:'); diff --git a/runtime/tests/vm/dart_2/isolates/test_utils.dart b/runtime/tests/vm/dart_2/isolates/test_utils.dart index a57bb41fb86..6f6c883cd0a 100644 --- a/runtime/tests/vm/dart_2/isolates/test_utils.dart +++ b/runtime/tests/vm/dart_2/isolates/test_utils.dart @@ -9,7 +9,7 @@ import 'dart:io'; import 'dart:isolate'; export '../../../../../benchmarks/IsolateFibonacci/dart2/IsolateFibonacci.dart' - show fibonacciRecursive; + show fibonacciRecursive; final bool isDebugMode = Platform.script.path.contains('Debug'); final bool isSimulator = Platform.script.path.contains('SIM'); diff --git a/runtime/tests/vm/dart_2/regress_39767_test.dart b/runtime/tests/vm/dart_2/regress_39767_test.dart index 24e9b13d6c3..78d11b68825 100644 --- a/runtime/tests/vm/dart_2/regress_39767_test.dart +++ b/runtime/tests/vm/dart_2/regress_39767_test.dart @@ -15,18 +15,19 @@ List var25 = List.filled(8, 0); -double foo0(){ - do { - throw {}; //# 01: runtime error - } while (false); +double foo0() { + do { + throw {}; //# 01: runtime error + } while (false); } main() { - do { - switch (1){ - case 1: { - var25[7] = foo0(); - } + do { + switch (1) { + case 1: + { + var25[7] = foo0(); } - } while (false); + } + } while (false); } diff --git a/runtime/tests/vm/dart_2/regress_49372_deferred.dart b/runtime/tests/vm/dart_2/regress_49372_deferred.dart index 5c5ce0fb27d..7a6703d06f7 100644 --- a/runtime/tests/vm/dart_2/regress_49372_deferred.dart +++ b/runtime/tests/vm/dart_2/regress_49372_deferred.dart @@ -11,4 +11,4 @@ int foo() => 10; @pragma('vm:never-inline') -int bar() => foo() + 2; \ No newline at end of file +int bar() => foo() + 2; diff --git a/tests/language/record_literal_test.dart b/tests/language/record_literal_test.dart index f6ac1bf1e56..e761bb1f4f0 100644 --- a/tests/language/record_literal_test.dart +++ b/tests/language/record_literal_test.dart @@ -9,9 +9,18 @@ main() { print(record1); // With ending comma. - var record2 = (42, 42, 42, ); + var record2 = ( + 42, + 42, + 42, + ); print(record2); - var record3 = (foo: 42, bar: 42, 42, baz: 42, ); + var record3 = ( + foo: 42, + bar: 42, + 42, + baz: 42, + ); print(record3); // Nested. @@ -23,11 +32,11 @@ main() { print(record5); // 1 record entry with trailing comma. - var record6 = (42, ); + var record6 = (42,); print(record6); // Const records. - var record7 = const (42, ); + var record7 = const (42,); print(record7); var record8 = const (42, foo: "bar"); print(record8); diff --git a/tests/language/record_type_test.dart b/tests/language/record_type_test.dart index cd2ff2f073a..e8cbdc57e43 100644 --- a/tests/language/record_type_test.dart +++ b/tests/language/record_type_test.dart @@ -11,10 +11,16 @@ main() { (int x, int y) record1Named = (1, 2); print(record1Named); - (int, int, ) record2 = (1, 2); + ( + int, + int, + ) record2 = (1, 2); print(record2); - (int x, int y, ) record2Named = (1, 2); + ( + int x, + int y, + ) record2Named = (1, 2); print(record2Named); (int, int, {int a, int b}) record3 = (1, 2, a: 3, b: 4); @@ -23,17 +29,29 @@ main() { (int x, int y, {int a, int b}) record3Named = (1, 2, a: 3, b: 4); print(record3Named); - (int, int, {int a, int b, }) record4 = (1, 2, a: 3, b: 4); + ( + int, + int, { + int a, + int b, + }) record4 = (1, 2, a: 3, b: 4); print(record4); - (int x, int y, {int a, int b, }) record4Named = (1, 2, a: 3, b: 4); + ( + int x, + int y, { + int a, + int b, + }) record4Named = (1, 2, a: 3, b: 4); print(record4Named); print(foo((42, b: true), 42)); Bar b = new Bar(); print(b.foo(42)); - (int, int) Function ((int, int) a) z1 = ((int, int) a) { return (42, 42); }; + (int, int) Function((int, int) a) z1 = ((int, int) a) { + return (42, 42); + }; final (int x, int y) finalRecordType = (42, 42); @@ -41,7 +59,7 @@ main() { var listOfRecords2 = <(int, int)>[]; - (int, ) oneElementRecord = (1, ); + (int,) oneElementRecord = (1,); print(oneElementRecord); ({int ok}) oneElementNamedRecord = (ok: 1); @@ -58,7 +76,10 @@ main() { (int, int) foo((int, {bool b}) inputRecord, int x) { if (inputRecord.b) return (42, 42); - return (1, 1, ); + return ( + 1, + 1, + ); } class Bar { @@ -76,4 +97,3 @@ class Bar { (int, T) f2(T t) => (42, t); } - diff --git a/tests/language/records/simple/constants_and_field_access_test.dart b/tests/language/records/simple/constants_and_field_access_test.dart index 8934396243f..ffbf5befdfc 100644 --- a/tests/language/records/simple/constants_and_field_access_test.dart +++ b/tests/language/records/simple/constants_and_field_access_test.dart @@ -13,7 +13,8 @@ void checkRecordP2(Object? e1, Object? e2, (Object?, Object?) r) { Expect.equals(e2, r.$2); } -void checkRecordP3(Object? e1, Object? e2, Object? e3, (Object? e1, Object? e2, Object? e3) r) { +void checkRecordP3(Object? e1, Object? e2, Object? e3, + (Object? e1, Object? e2, Object? e3) r) { Expect.equals(e1, r.$1); Expect.equals(e2, r.$2); Expect.equals(e3, r.$3); @@ -28,7 +29,8 @@ void checkRecordN2(Object? foo, Object? bar, ({Object? foo, Object? bar}) r) { Expect.equals(bar, r.bar); } -void checkRecordN3(Object? foo, Object? bar, Object? baz, ({Object? foo, Object? bar, Object? baz}) r) { +void checkRecordN3(Object? foo, Object? bar, Object? baz, + ({Object? foo, Object? bar, Object? baz}) r) { Expect.equals(foo, r.foo); Expect.equals(bar, r.bar); Expect.equals(baz, r.baz); @@ -39,13 +41,28 @@ void checkRecordP1N1(Object? e1, Object? foo, (Object?, {Object? foo}) r) { Expect.equals(foo, r.foo); } -void checkRecordP1N2(Object? e1, Object? foo, Object? bar, (Object? e1, {Object? foo, Object? bar, }) r) { +void checkRecordP1N2( + Object? e1, + Object? foo, + Object? bar, + ( + Object? e1, { + Object? foo, + Object? bar, + }) r) { Expect.equals(e1, r.$1); Expect.equals(foo, r.foo); Expect.equals(bar, r.bar); } -void checkRecordP3N3(Object? e1, Object? e2, Object? e3, Object? foo, Object? bar, Object? baz, (Object?, Object?, Object?, {Object? foo, Object? baz, Object? bar}) r) { +void checkRecordP3N3( + Object? e1, + Object? e2, + Object? e3, + Object? foo, + Object? bar, + Object? baz, + (Object?, Object?, Object?, {Object? foo, Object? baz, Object? bar}) r) { Expect.equals(bar, r.bar); Expect.equals(foo, r.foo); Expect.equals(baz, r.baz); @@ -64,7 +81,7 @@ void checkRecordP3N3(Object? e1, Object? e2, Object? e3, Object? foo, Object? ba class A { final int v; const A(this.v); - operator==(Object other) => other is A && v == other.v; + operator ==(Object other) => other is A && v == other.v; } const int two = 2; @@ -75,7 +92,8 @@ main() { checkRecordN1("FOO", const (foo: "FOO")); checkRecordN1(const [1, 2, 3], const (foo: [1, 2, 3])); - checkRecordN2(const {1, 2, 3}, const A(20), const (foo: const {1, 2, 3}, bar: A(20))); + checkRecordN2( + const {1, 2, 3}, const A(20), const (foo: const {1, 2, 3}, bar: A(20))); checkRecordN3(A(10), 1.0, 42, const (foo: A(10), bar: 1.0, baz: 40 + 2)); @@ -83,5 +101,19 @@ main() { checkRecordP1N2(A(1), A(2), A(3), const (foo: A(2), A(1), bar: A(3))); - checkRecordP3N3(1, 2.0, 'hey', A(10), const A(20), const ['hi'], const (2 - 1, 2.0, 'h' + 'ey', foo: A(3 + 7), baz: ['hi'], bar: A(10*2), )); + checkRecordP3N3( + 1, + 2.0, + 'hey', + A(10), + const A(20), + const ['hi'], + const ( + 2 - 1, + 2.0, + 'h' + 'ey', + foo: A(3 + 7), + baz: ['hi'], + bar: A(10 * 2), + )); } diff --git a/tests/language/records/simple/dynamic_field_access_test.dart b/tests/language/records/simple/dynamic_field_access_test.dart index 1fdf05ca751..b3406759a7c 100644 --- a/tests/language/records/simple/dynamic_field_access_test.dart +++ b/tests/language/records/simple/dynamic_field_access_test.dart @@ -28,9 +28,12 @@ foo2(int arg) { dynamic r1 = runtimeTrue ? (2, 3) as dynamic : A(); dynamic r2 = runtimeTrue ? (foo: 'hey') as dynamic : A(); -dynamic r3 = runtimeTrue ? const (10, 'a', foo: [1], bar: (50, baz: 60)) as dynamic: A(); -dynamic r4 = runtimeTrue ? (foo1, foo2: foo2) as dynamic: A(); -dynamic r5 = runtimeTrue ? (10, $2: 20, $1000000000000000000: 'meow') as dynamic: A(); +dynamic r3 = runtimeTrue + ? const (10, 'a', foo: [1], bar: (50, baz: 60)) as dynamic + : A(); +dynamic r4 = runtimeTrue ? (foo1, foo2: foo2) as dynamic : A(); +dynamic r5 = + runtimeTrue ? (10, $2: 20, $1000000000000000000: 'meow') as dynamic : A(); main() { Expect.equals(2, r1.$1); @@ -38,10 +41,13 @@ main() { Expect.throwsNoSuchMethodError(() => r1.$3); Expect.throwsNoSuchMethodError(() => r1.$4); Expect.throwsNoSuchMethodError(() => r1.$10000000000); - Expect.throwsNoSuchMethodError(() => r1.$99999999999999999999999999999999999999999999999); + Expect.throwsNoSuchMethodError( + () => r1.$99999999999999999999999999999999999999999999999); Expect.throwsNoSuchMethodError(() => r1.foo); Expect.equals((2, 3).toString(), r1.toString()); - Expect.throwsNoSuchMethodError(() { r1.$1 = 4; }); + Expect.throwsNoSuchMethodError(() { + r1.$1 = 4; + }); Expect.equals('hey', r2.foo); Expect.throwsNoSuchMethodError(() => r2.$1); @@ -49,7 +55,9 @@ main() { Expect.throwsNoSuchMethodError(() => r2.fo); Expect.throwsNoSuchMethodError(() => r2.$foo); Expect.throwsNoSuchMethodError(() => r2.bar); - Expect.throwsNoSuchMethodError(() { r2.foo = 'bye'; }); + Expect.throwsNoSuchMethodError(() { + r2.foo = 'bye'; + }); Expect.equals(10, r3.$1); Expect.equals('a', r3.$2); @@ -61,16 +69,30 @@ main() { Expect.throwsNoSuchMethodError(() => r3.baz); Expect.throwsNoSuchMethodError(() => r3.bar.$2); Expect.throwsNoSuchMethodError(() => r3.bar.bar); - Expect.throwsNoSuchMethodError(() { r3.$1 = 10; }); - Expect.throwsNoSuchMethodError(() { r3.foo = const [1]; }); - Expect.throwsNoSuchMethodError(() { r3.bar.$1 = 50; }); - Expect.throwsNoSuchMethodError(() { r3.bar.$2 = 50; }); - Expect.throwsNoSuchMethodError(() { r3.bar.baz = 60; }); + Expect.throwsNoSuchMethodError(() { + r3.$1 = 10; + }); + Expect.throwsNoSuchMethodError(() { + r3.foo = const [1]; + }); + Expect.throwsNoSuchMethodError(() { + r3.bar.$1 = 50; + }); + Expect.throwsNoSuchMethodError(() { + r3.bar.$2 = 50; + }); + Expect.throwsNoSuchMethodError(() { + r3.bar.baz = 60; + }); Expect.equals('Hi from foo1', r4.$1()); Expect.equals('Hi from foo2', r4.foo2(42)); - Expect.throwsNoSuchMethodError(() { r4.foo2(42, 42); }); - Expect.throwsTypeError(() { r4.foo2('not int'); } ); + Expect.throwsNoSuchMethodError(() { + r4.foo2(42, 42); + }); + Expect.throwsTypeError(() { + r4.foo2('not int'); + }); Expect.equals(10, r5.$1); Expect.equals(20, r5.$2); diff --git a/tests/language/records/simple/equals_and_hashcode_test.dart b/tests/language/records/simple/equals_and_hashcode_test.dart index 2f6036be710..836763b31f0 100644 --- a/tests/language/records/simple/equals_and_hashcode_test.dart +++ b/tests/language/records/simple/equals_and_hashcode_test.dart @@ -6,16 +6,15 @@ import "package:expect/expect.dart"; - class NotEqual { - bool operator==(Object other) => false; + bool operator ==(Object other) => false; } class A { final int i; const A(this.i); - bool operator==(Object other) => other is A && i == other.i; + bool operator ==(Object other) => other is A && i == other.i; int get hashCode => i; } @@ -26,7 +25,7 @@ class B { B(this.i); - bool operator==(Object other) { + bool operator ==(Object other) { equalsCalled = true; return other is B && i == other.i; } @@ -49,8 +48,10 @@ checkNotEquals(Object? a, Object? b) { main() { checkEqualsAndHash((1, 2), (1, 2)); checkEqualsAndHash((1, 2), const (1, 2)); - checkEqualsAndHash(const (42, foo: "hello3"), (foo: "hello${int.parse("3")}", 40 + int.parse("2"))); - checkEqualsAndHash((1, 2, 3, foo: 4, bar: 5, baz: 6), (baz: 6, 1, bar: 5, 2, foo: 4, int.parse("3"))); + checkEqualsAndHash(const (42, foo: "hello3"), + (foo: "hello${int.parse("3")}", 40 + int.parse("2"))); + checkEqualsAndHash((1, 2, 3, foo: 4, bar: 5, baz: 6), + (baz: 6, 1, bar: 5, 2, foo: 4, int.parse("3"))); checkEqualsAndHash((foo: 1, 2), (2, foo: 1)); checkEqualsAndHash((foo: 3), (foo: 3)); diff --git a/tests/language/records/simple/literals_and_field_access_test.dart b/tests/language/records/simple/literals_and_field_access_test.dart index 960de1faa55..e88fb185031 100644 --- a/tests/language/records/simple/literals_and_field_access_test.dart +++ b/tests/language/records/simple/literals_and_field_access_test.dart @@ -11,7 +11,8 @@ void checkRecordP2(Object? e1, Object? e2, (Object?, Object?) r) { Expect.equals(e2, r.$2); } -void checkRecordP3(Object? e1, Object? e2, Object? e3, (Object? e1, Object? e2, Object? e3) r) { +void checkRecordP3(Object? e1, Object? e2, Object? e3, + (Object? e1, Object? e2, Object? e3) r) { Expect.equals(e1, r.$1); Expect.equals(e2, r.$2); Expect.equals(e3, r.$3); @@ -26,7 +27,8 @@ void checkRecordN2(Object? foo, Object? bar, ({Object? foo, Object? bar}) r) { Expect.equals(bar, r.bar); } -void checkRecordN3(Object? foo, Object? bar, Object? baz, ({Object? foo, Object? bar, Object? baz}) r) { +void checkRecordN3(Object? foo, Object? bar, Object? baz, + ({Object? foo, Object? bar, Object? baz}) r) { Expect.equals(foo, r.foo); Expect.equals(bar, r.bar); Expect.equals(baz, r.baz); @@ -37,13 +39,28 @@ void checkRecordP1N1(Object? e1, Object? foo, (Object?, {Object? foo}) r) { Expect.equals(foo, r.foo); } -void checkRecordP1N2(Object? e1, Object? foo, Object? bar, (Object? e1, {Object? foo, Object? bar, }) r) { +void checkRecordP1N2( + Object? e1, + Object? foo, + Object? bar, + ( + Object? e1, { + Object? foo, + Object? bar, + }) r) { Expect.equals(e1, r.$1); Expect.equals(foo, r.foo); Expect.equals(bar, r.bar); } -void checkRecordP3N3(Object? e1, Object? e2, Object? e3, Object? foo, Object? bar, Object? baz, (Object?, Object?, Object?, {Object? foo, Object? baz, Object? bar}) r) { +void checkRecordP3N3( + Object? e1, + Object? e2, + Object? e3, + Object? foo, + Object? bar, + Object? baz, + (Object?, Object?, Object?, {Object? foo, Object? baz, Object? bar}) r) { Expect.equals(bar, r.bar); Expect.equals(foo, r.foo); Expect.equals(baz, r.baz); @@ -61,16 +78,36 @@ void checkRecordP3N3(Object? e1, Object? e2, Object? e3, Object? foo, Object? ba return getP1N1Rec(n - 1, x, y); } -(dynamic, dynamic, dynamic, {dynamic foo, dynamic bar, dynamic baz, }) getP3N3(int i, String s) { - (dynamic, dynamic, {dynamic foo, dynamic qq, dynamic baz}) r1 = (s.substring(i, i+1), s.substring(i, i+2), foo: s.substring(i, i+4), qq: i, baz: s.substring(i, i+6)); - (dynamic, dynamic, dynamic, {dynamic foo, dynamic bar, dynamic baz}) r2 = (r1.$1, r1.$2, s.substring(i, i+3), foo: r1.foo, bar: s.substring(i, i+5), baz: r1.baz); +( + dynamic, + dynamic, + dynamic, { + dynamic foo, + dynamic bar, + dynamic baz, +}) getP3N3(int i, String s) { + (dynamic, dynamic, {dynamic foo, dynamic qq, dynamic baz}) r1 = ( + s.substring(i, i + 1), + s.substring(i, i + 2), + foo: s.substring(i, i + 4), + qq: i, + baz: s.substring(i, i + 6) + ); + (dynamic, dynamic, dynamic, {dynamic foo, dynamic bar, dynamic baz}) r2 = ( + r1.$1, + r1.$2, + s.substring(i, i + 3), + foo: r1.foo, + bar: s.substring(i, i + 5), + baz: r1.baz + ); return r2; } class A { final int v; A(this.v); - operator==(Object other) => other is A && v == other.v; + operator ==(Object other) => other is A && v == other.v; } main() { @@ -81,13 +118,16 @@ main() { final x = [1, 2, 3]; checkRecordN1(x, getN1(x)); - checkRecordN2("0 1 2", "[1, 2, 3]", (foo: [for (int i = 0; i < 3; ++i) i].join(' '), bar: x.toString())); + checkRecordN2("0 1 2", "[1, 2, 3]", + (foo: [for (int i = 0; i < 3; ++i) i].join(' '), bar: x.toString())); - checkRecordN3(A(10), 1.0, 42, (foo: A(9 + int.parse("1")), bar: 1.0, baz: 40 + A(2).v)); + checkRecordN3( + A(10), 1.0, 42, (foo: A(9 + int.parse("1")), bar: 1.0, baz: 40 + A(2).v)); checkRecordP1N1(10, "abc", getP1N1(10, "abc")); checkRecordP1N2(A(1), A(2), A(3), (foo: A(2), A(1), bar: A(3))); - checkRecordP3N3("h", "he", "hel", "hell", "hello", "hello,", [for (int i = 0; i < 3; ++i) getP3N3(i, "hello, world") ][0]); + checkRecordP3N3("h", "he", "hel", "hell", "hello", "hello,", + [for (int i = 0; i < 3; ++i) getP3N3(i, "hello, world")][0]); } diff --git a/tests/language/records/simple/runtime_type_test.dart b/tests/language/records/simple/runtime_type_test.dart index 943404fd697..23ea3a9bb6b 100644 --- a/tests/language/records/simple/runtime_type_test.dart +++ b/tests/language/records/simple/runtime_type_test.dart @@ -26,8 +26,10 @@ main() { Expect.equals(getType2(), getType1(false)); Expect.equals(getType2(), getType1(1)); Expect.equals(getType2<(bool, int)>(), getType1((true, 3))); - Expect.equals(getType2<({int bar, bool foo})>(), getType1((foo: true, bar: 2))); - Expect.equals(getType2<(int, bool, {int bar, bool foo})>(), getType1((1, foo: true, false, bar: 2))); + Expect.equals( + getType2<({int bar, bool foo})>(), getType1((foo: true, bar: 2))); + Expect.equals(getType2<(int, bool, {int bar, bool foo})>(), + getType1((1, foo: true, false, bar: 2))); testRuntimeTypeEquality(true, (1, 2), (3, 4)); testRuntimeTypeEquality(false, (1, 2), (1, 2, 3)); diff --git a/tests/language/records/simple/to_string_test.dart b/tests/language/records/simple/to_string_test.dart index ad91b78df33..4664cebed81 100644 --- a/tests/language/records/simple/to_string_test.dart +++ b/tests/language/records/simple/to_string_test.dart @@ -27,7 +27,15 @@ main() { Expect.equals("(1, foo: 2)", (1, foo: 2).toString()); Expect.equals("(1, foo: 2)", (foo: 2, 1).toString()); - Expect.equals("(1, abc, bar: 3, foo: 2)", (1, foo: 2, "abc", bar: 3).toString()); + Expect.equals( + "(1, abc, bar: 3, foo: 2)", (1, foo: 2, "abc", bar: 3).toString()); - Expect.equals("((A1, A2), (foo: A3), (A7, bar: A5, baz: A6, foo: A4))", ((A("A1"), A("A2")), const (foo: A("A3")), (foo: A("A4"), bar: A("A5"), baz: A("A6"), A("A7"))).toString()); + Expect.equals( + "((A1, A2), (foo: A3), (A7, bar: A5, baz: A6, foo: A4))", + ( + (A("A1"), A("A2")), + const (foo: A("A3")), + (foo: A("A4"), bar: A("A5"), baz: A("A6"), A("A7")) + ) + .toString()); } diff --git a/tests/language/records/simple/type_checks2_test.dart b/tests/language/records/simple/type_checks2_test.dart index 152074b3e0f..cb0a1a0c418 100644 --- a/tests/language/records/simple/type_checks2_test.dart +++ b/tests/language/records/simple/type_checks2_test.dart @@ -7,8 +7,7 @@ import "package:expect/expect.dart"; -class A { -} +class A {} class B { void foo(T x) {} @@ -28,8 +27,10 @@ class D2 implements C { } B<(num, num)> b1 = (int.parse('1') == 1) ? B<(int, int)>() : B<(num, num)>(); -B<({num foo})?> b2 = (int.parse('1') == 1) ? B<({int foo})>() : B<({num foo})?>(); -B<(num?, {num? foo})?> b3 = (int.parse('1') == 1) ? B<(int, {int? foo})?>() : B<(num?, {num? foo})?>(); +B<({num foo})?> b2 = + (int.parse('1') == 1) ? B<({int foo})>() : B<({num foo})?>(); +B<(num?, {num? foo})?> b3 = + (int.parse('1') == 1) ? B<(int, {int? foo})?>() : B<(num?, {num? foo})?>(); C d1 = (int.parse('1') == 1) ? D1() : C(); C d2 = (int.parse('1') == 1) ? D2() : C(); diff --git a/tests/language/records/simple/type_checks3_test.dart b/tests/language/records/simple/type_checks3_test.dart index 84620d3017c..08c8b6b111f 100644 --- a/tests/language/records/simple/type_checks3_test.dart +++ b/tests/language/records/simple/type_checks3_test.dart @@ -7,8 +7,7 @@ import "package:expect/expect.dart"; -class A { -} +class A {} class B { void foo(T x) {} @@ -16,8 +15,10 @@ class B { } B<(num, num)> b1 = (int.parse('1') == 1) ? B<(int, int)>() : B<(num, num)>(); -B<({num foo})?> b2 = (int.parse('1') == 1) ? B<({int foo})>() : B<({num foo})?>(); -B<(num?, {num? foo})?> b3 = (int.parse('1') == 1) ? B<(int, {int? foo})?>() : B<(num?, {num? foo})?>(); +B<({num foo})?> b2 = + (int.parse('1') == 1) ? B<({int foo})>() : B<({num foo})?>(); +B<(num?, {num? foo})?> b3 = + (int.parse('1') == 1) ? B<(int, {int? foo})?>() : B<(num?, {num? foo})?>(); doTests() { b1 as B<(int, int)>; diff --git a/tests/language/records/simple/type_checks_test.dart b/tests/language/records/simple/type_checks_test.dart index 4726f949d82..0172e0034e7 100644 --- a/tests/language/records/simple/type_checks_test.dart +++ b/tests/language/records/simple/type_checks_test.dart @@ -38,14 +38,22 @@ verifyIsTests() { Expect.isFalse(getN2([], 10) is ({List foo, num bar, int baz})); Expect.isFalse(getN2([], 10) is (List foo, {num bar})); - Expect.isTrue(getP2N2(const [42], {1: 'hi'}, A(), 10) is (List, Map, {A foo, int bar})); - Expect.isTrue(getP2N2(const [42], {1: 'hi'}, A(), 10) is (List, Map, {A foo, int? bar})); - Expect.isTrue(getP2N2(const [42], {1: 'hi'}, A(), 10) is (List, Map, {A foo, dynamic bar})); - Expect.isTrue(getP2N2(const [42], {1: 'hi'}, A(), 10) is (dynamic, dynamic, {dynamic foo, dynamic bar})); - Expect.isFalse(getP2N2(const [42], {1: 'hi'}, A(), 10) is (dynamic, dynamic, {dynamic foo, dynamic baz})); - Expect.isFalse(getP2N2(const [42], {1: 'hi'}, A(), 10) is (dynamic, dynamic, dynamic, {dynamic foo, dynamic bar})); - Expect.isFalse(getP2N2(const [42], {1: 'hi'}, A(), 10) is (dynamic, dynamic, dynamic foo, dynamic bar)); - Expect.isFalse(getP2N2(const [42], {1: 'hi'}, A(), 10) is (dynamic, dynamic, {dynamic foo, dynamic bar, dynamic baz})); + Expect.isTrue(getP2N2(const [42], {1: 'hi'}, A(), 10) + is (List, Map, {A foo, int bar})); + Expect.isTrue(getP2N2(const [42], {1: 'hi'}, A(), 10) + is (List, Map, {A foo, int? bar})); + Expect.isTrue(getP2N2(const [42], {1: 'hi'}, A(), 10) + is (List, Map, {A foo, dynamic bar})); + Expect.isTrue(getP2N2(const [42], {1: 'hi'}, A(), 10) + is (dynamic, dynamic, {dynamic foo, dynamic bar})); + Expect.isFalse(getP2N2(const [42], {1: 'hi'}, A(), 10) + is (dynamic, dynamic, {dynamic foo, dynamic baz})); + Expect.isFalse(getP2N2(const [42], {1: 'hi'}, A(), 10) + is (dynamic, dynamic, dynamic, {dynamic foo, dynamic bar})); + Expect.isFalse(getP2N2(const [42], {1: 'hi'}, A(), 10) + is (dynamic, dynamic, dynamic foo, dynamic bar)); + Expect.isFalse(getP2N2(const [42], {1: 'hi'}, A(), 10) + is (dynamic, dynamic, {dynamic foo, dynamic bar, dynamic baz})); } verifyAsChecks() { @@ -68,17 +76,48 @@ verifyAsChecks() { results.add(getN2([], 10) as ({num bar, List foo})); Expect.throwsTypeError(() => getN2([], 10) as ({List bar, num foo})); Expect.throwsTypeError(() => getN2([], 10) as ({List foo})); - Expect.throwsTypeError(() => getN2([], 10) as ({List foo, num bar, int baz})); + Expect.throwsTypeError( + () => getN2([], 10) as ({List foo, num bar, int baz})); Expect.throwsTypeError(() => getN2([], 10) as (List foo, {num bar})); - results.add(getP2N2(const [42], {1: 'hi'}, A(), 10) as (List, Map, {A foo, int bar})); - results.add(getP2N2(const [42], {1: 'hi'}, A(), 10) as (List, Map, {A foo, int? bar})); - results.add(getP2N2(const [42], {1: 'hi'}, A(), 10) as (List, Map, {A foo, dynamic bar})); - results.add(getP2N2(const [42], {1: 'hi'}, A(), 10) as (dynamic, dynamic, {dynamic foo, dynamic bar})); - Expect.throwsTypeError(() => getP2N2(const [42], {1: 'hi'}, A(), 10) as (dynamic, dynamic, {dynamic foo, dynamic baz})); - Expect.throwsTypeError(() => getP2N2(const [42], {1: 'hi'}, A(), 10) as (dynamic, dynamic, dynamic, {dynamic foo, dynamic bar})); - Expect.throwsTypeError(() => getP2N2(const [42], {1: 'hi'}, A(), 10) as (dynamic, dynamic, dynamic foo, dynamic bar)); - Expect.throwsTypeError(() => getP2N2(const [42], {1: 'hi'}, A(), 10) as (dynamic, dynamic, {dynamic foo, dynamic bar, dynamic baz})); + results.add(getP2N2(const [42], {1: 'hi'}, A(), 10) + as (List, Map, {A foo, int bar})); + results.add(getP2N2(const [42], {1: 'hi'}, A(), 10) + as (List, Map, {A foo, int? bar})); + results.add(getP2N2(const [42], {1: 'hi'}, A(), 10) + as (List, Map, {A foo, dynamic bar})); + results.add(getP2N2(const [42], {1: 'hi'}, A(), 10) + as (dynamic, dynamic, {dynamic foo, dynamic bar})); + Expect.throwsTypeError(() => + getP2N2(const [42], {1: 'hi'}, A(), 10) as ( + dynamic, + dynamic, { + dynamic foo, + dynamic baz + })); + Expect.throwsTypeError(() => + getP2N2(const [42], {1: 'hi'}, A(), 10) as ( + dynamic, + dynamic, + dynamic, { + dynamic foo, + dynamic bar + })); + Expect.throwsTypeError(() => + getP2N2(const [42], {1: 'hi'}, A(), 10) as ( + dynamic, + dynamic, + dynamic foo, + dynamic bar + )); + Expect.throwsTypeError(() => + getP2N2(const [42], {1: 'hi'}, A(), 10) as ( + dynamic, + dynamic, { + dynamic foo, + dynamic bar, + dynamic baz + })); return results; } @@ -99,27 +138,61 @@ verifyParameterTypeChecks() { checkParameterType<(int, String)>(getP2(10, 'abc')); checkParameterType<(int foo, String bar)>(getP2(10, 'abc')); checkParameterType<(int bar, String foo)>(getP2(10, 'abc')); - Expect.throwsTypeError(() => checkParameterType<(String bar, int foo)>(getP2(10, 'abc'))); - Expect.throwsTypeError(() => checkParameterType<({int foo, String bar})>(getP2(10, 'abc'))); - Expect.throwsTypeError(() => checkParameterType<(int foo, {String bar})>(getP2(10, 'abc'))); + Expect.throwsTypeError( + () => checkParameterType<(String bar, int foo)>(getP2(10, 'abc'))); + Expect.throwsTypeError( + () => checkParameterType<({int foo, String bar})>(getP2(10, 'abc'))); + Expect.throwsTypeError( + () => checkParameterType<(int foo, {String bar})>(getP2(10, 'abc'))); checkParameterType<({List foo, num bar})>(getN2([], 10)); checkParameterType<({List foo, Object bar})>(getN2([], 10)); checkParameterType<({List foo, int bar})>(getN2([], 10)); checkParameterType<({num bar, List foo})>(getN2([], 10)); - Expect.throwsTypeError(() => checkParameterType<({List bar, num foo})>(getN2([], 10))); - Expect.throwsTypeError(() => checkParameterType<({List foo})>(getN2([], 10))); - Expect.throwsTypeError(() => checkParameterType<({List foo, num bar, int baz})>(getN2([], 10))); - Expect.throwsTypeError(() => checkParameterType<(List foo, {num bar})>(getN2([], 10))); + Expect.throwsTypeError( + () => checkParameterType<({List bar, num foo})>(getN2([], 10))); + Expect.throwsTypeError( + () => checkParameterType<({List foo})>(getN2([], 10))); + Expect.throwsTypeError(() => + checkParameterType<({List foo, num bar, int baz})>(getN2([], 10))); + Expect.throwsTypeError( + () => checkParameterType<(List foo, {num bar})>(getN2([], 10))); - checkParameterType<(List, Map, {A foo, int bar})>(getP2N2(const [42], {1: 'hi'}, A(), 10)); - checkParameterType<(List, Map, {A foo, int? bar})>(getP2N2(const [42], {1: 'hi'}, A(), 10)); - checkParameterType<(List, Map, {A foo, dynamic bar})>(getP2N2(const [42], {1: 'hi'}, A(), 10)); - checkParameterType<(dynamic, dynamic, {dynamic foo, dynamic bar})>(getP2N2(const [42], {1: 'hi'}, A(), 10)); - Expect.throwsTypeError(() => checkParameterType<(dynamic, dynamic, {dynamic foo, dynamic baz})>(getP2N2(const [42], {1: 'hi'}, A(), 10))); - Expect.throwsTypeError(() => checkParameterType<(dynamic, dynamic, dynamic, {dynamic foo, dynamic bar})>(getP2N2(const [42], {1: 'hi'}, A(), 10))); - Expect.throwsTypeError(() => checkParameterType<(dynamic, dynamic, dynamic foo, dynamic bar)>(getP2N2(const [42], {1: 'hi'}, A(), 10))); - Expect.throwsTypeError(() => checkParameterType<(dynamic, dynamic, {dynamic foo, dynamic bar, dynamic baz})>(getP2N2(const [42], {1: 'hi'}, A(), 10))); + checkParameterType<(List, Map, {A foo, int bar})>( + getP2N2(const [42], {1: 'hi'}, A(), 10)); + checkParameterType<(List, Map, {A foo, int? bar})>( + getP2N2(const [42], {1: 'hi'}, A(), 10)); + checkParameterType< + ( + List, + Map, { + A foo, + dynamic bar + })>(getP2N2(const [42], {1: 'hi'}, A(), 10)); + checkParameterType<(dynamic, dynamic, {dynamic foo, dynamic bar})>( + getP2N2(const [42], {1: 'hi'}, A(), 10)); + Expect.throwsTypeError(() => + checkParameterType<(dynamic, dynamic, {dynamic foo, dynamic baz})>( + getP2N2(const [42], {1: 'hi'}, A(), 10))); + Expect.throwsTypeError(() => checkParameterType< + ( + dynamic, + dynamic, + dynamic, { + dynamic foo, + dynamic bar + })>(getP2N2(const [42], {1: 'hi'}, A(), 10))); + Expect.throwsTypeError(() => + checkParameterType<(dynamic, dynamic, dynamic foo, dynamic bar)>( + getP2N2(const [42], {1: 'hi'}, A(), 10))); + Expect.throwsTypeError(() => checkParameterType< + ( + dynamic, + dynamic, { + dynamic foo, + dynamic bar, + dynamic baz + })>(getP2N2(const [42], {1: 'hi'}, A(), 10))); } checkTypeParameterBound() { @@ -132,25 +205,34 @@ void verifyTypeParameterBoundsChecks() { checkTypeParameterBound<(int, int), (int, Object)>(); checkTypeParameterBound<(int, int), (int, int?)>(); checkTypeParameterBound<(int, int), (int, int)?>(); - Expect.throwsTypeError(() => checkTypeParameterBound<(int, Object), (int, int)>()); + Expect.throwsTypeError( + () => checkTypeParameterBound<(int, Object), (int, int)>()); if (hasSoundNullSafety) { - Expect.throwsTypeError(() => checkTypeParameterBound<(int, int?), (int, int)>()); - Expect.throwsTypeError(() => checkTypeParameterBound<(int, int)?, (int, int)>()); + Expect.throwsTypeError( + () => checkTypeParameterBound<(int, int?), (int, int)>()); + Expect.throwsTypeError( + () => checkTypeParameterBound<(int, int)?, (int, int)>()); } checkTypeParameterBound<(String, {int foo}), (String, {int foo})>(); - Expect.throwsTypeError(() => checkTypeParameterBound<(String, {int foo}), (String, {int bar})>()); - Expect.throwsTypeError(() => checkTypeParameterBound<(String, {num foo}), (String, {int foo})>()); + Expect.throwsTypeError(() => + checkTypeParameterBound<(String, {int foo}), (String, {int bar})>()); + Expect.throwsTypeError(() => + checkTypeParameterBound<(String, {num foo}), (String, {int foo})>()); if (hasSoundNullSafety) { - Expect.throwsTypeError(() => checkTypeParameterBound<(String, {int? foo}), (String, {int foo})>()); + Expect.throwsTypeError(() => + checkTypeParameterBound<(String, {int? foo}), (String, {int foo})>()); } checkTypeParameterBound<({int foo, Object bar}), ({Object bar, int foo})>(); - checkTypeParameterBound<({int foo, Object bar}), ({Object foo, Object? bar})>(); - Expect.throwsTypeError(() => checkTypeParameterBound<({int foo, Object bar}), ({Object foo, int bar})>()); + checkTypeParameterBound<({int foo, Object bar}), + ({Object foo, Object? bar})>(); + Expect.throwsTypeError(() => checkTypeParameterBound<({int foo, Object bar}), + ({Object foo, int bar})>()); checkTypeParameterBound<(int, String, double), (num, String, num)>(); - Expect.throwsTypeError(() => checkTypeParameterBound<(int, String, Object), (num, String, num)>()); + Expect.throwsTypeError(() => + checkTypeParameterBound<(int, String, Object), (num, String, num)>()); } doTests() {