Index: tests/compiler/dart2js/serialization/test_data.dart |
diff --git a/tests/compiler/dart2js/serialization/test_data.dart b/tests/compiler/dart2js/serialization/test_data.dart |
index 62126fd64173bc14a08cc4a79e1054caec682ba2..49f3f4454e60b89f2fb0fd3dfe041c8eff31202d 100644 |
--- a/tests/compiler/dart2js/serialization/test_data.dart |
+++ b/tests/compiler/dart2js/serialization/test_data.dart |
@@ -5,21 +5,21 @@ |
library dart2js.serialization_test_data; |
const List<Test> TESTS = const <Test>[ |
- const Test(const { |
+ const Test('Empty program', const { |
'main.dart': 'main() {}' |
}), |
- const Test(const { |
+ const Test('Hello World', const { |
'main.dart': 'main() => print("Hello World");' |
}), |
- const Test(const { |
+ const Test('Too many arguments to print', const { |
'main.dart': 'main() => print("Hello World", 0);' |
}, |
expectedWarningCount: 1, |
expectedInfoCount: 1), |
- const Test(const { |
+ const Test('Hello World with string interpolation', const { |
'main.dart': r''' |
main() { |
String text = "Hello World"; |
@@ -27,7 +27,7 @@ main() { |
}''' |
}), |
- const Test(const { |
+ const Test('Too many arguments to print with string interpolation', const { |
'main.dart': r''' |
main() { |
String text = "Hello World"; |
@@ -37,14 +37,14 @@ main() { |
expectedWarningCount: 1, |
expectedInfoCount: 1), |
- const Test(const { |
+ const Test('Print main arguments', const { |
'main.dart': r''' |
main(List<String> arguments) { |
print(arguments); |
}''' |
}), |
- const Test(const { |
+ const Test('For loop on main arguments', const { |
'main.dart': r''' |
main(List<String> arguments) { |
for (int i = 0; i < arguments.length; i++) { |
@@ -53,7 +53,7 @@ main(List<String> arguments) { |
}''' |
}), |
- const Test(const { |
+ const Test('For-in loop on main arguments', const { |
'main.dart': r''' |
main(List<String> arguments) { |
for (String argument in arguments) { |
@@ -62,7 +62,7 @@ main(List<String> arguments) { |
}''' |
}), |
- const Test(const { |
+ const Test('Simple class', const { |
'main.dart': r''' |
class Class {} |
main() { |
@@ -70,7 +70,7 @@ main() { |
}''' |
}), |
- const Test(const { |
+ const Test('Simple class implements Function without call method', const { |
'main.dart': r''' |
class Class implements Function {} |
main() { |
@@ -79,7 +79,7 @@ main() { |
}, |
expectedWarningCount: 1), |
- const Test(const { |
+ const Test('Simple class implements Function with call method', const { |
'main.dart': r''' |
class Class implements Function { |
call() {} |
@@ -89,7 +89,7 @@ main() { |
}''' |
}), |
- const Test(const { |
+ const Test('Implement Comparable', const { |
'main.dart': r''' |
class Class implements Comparable<Class> { |
int compareTo(Class other) => 0; |
@@ -99,7 +99,7 @@ main() { |
}''' |
}), |
- const Test(const { |
+ const Test('Implement Comparable with two many type arguments', const { |
'main.dart': r''' |
class Class implements Comparable<Class, Class> { |
int compareTo(other) => 0; |
@@ -110,7 +110,7 @@ main() { |
}, |
expectedWarningCount: 1), |
- const Test(const { |
+ const Test('Impliment Comparable with incompatible parameter types', const { |
'main.dart': r''' |
class Class implements Comparable<Class> { |
int compareTo(String other) => 0; |
@@ -122,7 +122,7 @@ main() { |
expectedWarningCount: 1, |
expectedInfoCount: 1), |
- const Test(const { |
+ const Test('Impliment Comparable with incompatible parameter count', const { |
'main.dart': r''' |
class Class implements Comparable { |
bool compareTo(a, b) => true; |
@@ -134,7 +134,7 @@ main() { |
expectedWarningCount: 1, |
expectedInfoCount: 1), |
- const Test(const { |
+ const Test('Implement Random and call nextInt directly', const { |
'main.dart': r''' |
import 'dart:math'; |
@@ -152,7 +152,7 @@ main() { |
expectedWarningCount: 1, |
expectedInfoCount: 0), |
- const Test(const { |
+ const Test('Implement Random and do not call nextInt', const { |
'main.dart': r''' |
import 'dart:math'; |
@@ -168,7 +168,7 @@ main() { |
}''' |
}), |
- const Test(const { |
+ const Test('Implement Random and call nextInt through native code', const { |
'main.dart': r''' |
import 'dart:math'; |
@@ -189,7 +189,7 @@ main() { |
expectedWarningCount: 1, |
expectedInfoCount: 0), |
- const Test(const { |
+ const Test('Handle break and continue', const { |
'main.dart': ''' |
main() { |
loop: for (var a in []) { |
@@ -201,7 +201,7 @@ main() { |
}''' |
}), |
- const Test(const { |
+ const Test('Explicit default constructor', const { |
'main.dart': ''' |
class A { |
A(); |
@@ -210,7 +210,20 @@ main() => new A(); |
''', |
}), |
- const Test(const { |
+ const Test('Explicit default constructor, preserialized', const { |
+ 'main.dart': ''' |
+import 'lib.dart'; |
+main() => new A(); |
+ ''', |
+ }, preserializedSourceFiles: const { |
+ 'lib.dart': ''' |
+class A { |
+ A(); |
+} |
+''', |
+ }), |
+ |
+ const Test('Const constructor', const { |
'main.dart': ''' |
class C { |
const C(); |
@@ -218,7 +231,7 @@ class C { |
main() => const C();''' |
}), |
- const Test(const { |
+ const Test('Redirecting factory', const { |
'main.dart': ''' |
class C { |
factory C() = Object; |
@@ -226,7 +239,7 @@ class C { |
main() => new C();''' |
}), |
- const Test(const { |
+ const Test('Redirecting factory with optional arguments', const { |
'main.dart': ''' |
abstract class C implements List { |
factory C([_]) = List; |
@@ -234,27 +247,28 @@ abstract class C implements List { |
main() => new C();''' |
}), |
- const Test(const { |
+ const Test('Constructed constant using its default values.', const { |
'main.dart': ''' |
main() => const Duration(); |
''', |
}), |
- const Test(const { |
- 'main.dart': ''' |
+ const Test('Call forwarding constructor on named mixin application', |
+ const { |
+ 'main.dart': ''' |
import 'dart:collection'; |
main() => new UnmodifiableListView(null); |
''', |
}), |
- const Test(const { |
+ const Test('Function reference constant', const { |
'main.dart': ''' |
var myIdentical = identical; |
main() => myIdentical; |
''', |
}), |
- const Test(const { |
+ const Test('Super method call', const { |
'main.dart': ''' |
class Foo { |
String toString() => super.toString(); |
@@ -264,18 +278,53 @@ main() { |
} |
''', |
}), |
+ |
+ const Test('Call forwarding constructor on named mixin application, no args.', |
+ const { |
+ 'main.dart': ''' |
+import 'lib.dart'; |
+main() => new C(); |
+''', |
+ }, preserializedSourceFiles: const { |
+ 'lib.dart': ''' |
+class M {} |
+class S {} |
+class C = S with M; |
+''', |
+ }), |
+ |
+ const Test('Call forwarding constructor on named mixin application, one arg.', |
+ const { |
+ 'main.dart': ''' |
+import 'lib.dart'; |
+main() => new C(0); |
+''', |
+ }, preserializedSourceFiles: const { |
+ 'lib.dart': ''' |
+class M {} |
+class S { |
+ S(a); |
+} |
+class C = S with M; |
+''', |
+ }), |
]; |
class Test { |
+ final String name; |
final Map sourceFiles; |
+ final Map preserializedSourceFiles; |
final int expectedErrorCount; |
final int expectedWarningCount; |
final int expectedHintCount; |
final int expectedInfoCount; |
- const Test(this.sourceFiles, { |
- this.expectedErrorCount: 0, |
- this.expectedWarningCount: 0, |
- this.expectedHintCount: 0, |
- this.expectedInfoCount: 0}); |
+ const Test( |
+ this.name, |
+ this.sourceFiles, |
+ {this.preserializedSourceFiles, |
+ this.expectedErrorCount: 0, |
+ this.expectedWarningCount: 0, |
+ this.expectedHintCount: 0, |
+ this.expectedInfoCount: 0}); |
} |