Chromium Code Reviews| Index: dart/tests/try/web/incremental_compilation_update_test.dart |
| diff --git a/dart/tests/try/web/incremental_compilation_update_test.dart b/dart/tests/try/web/incremental_compilation_update_test.dart |
| index aacc82f25e925876cd3c7695d2bc751dbb971c60..fa58949d0f7f3051591c92128adcb59a7ea708af 100644 |
| --- a/dart/tests/try/web/incremental_compilation_update_test.dart |
| +++ b/dart/tests/try/web/incremental_compilation_update_test.dart |
| @@ -44,66 +44,75 @@ import 'program_result.dart'; |
| const int TIMEOUT = 100; |
| -const List<List<ProgramResult>> tests = const <List<ProgramResult>>[ |
| +const List tests = const [ |
| // Basic hello-world test. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| - "main() { print('Hello, World!'); }", |
| - const <String> ['Hello, World!']), |
| - const ProgramResult( |
| - "main() { print('Hello, Brave New World!'); }", |
| - const <String> ['Hello, Brave New World!']), |
| + const [ |
|
Johnni Winther
2014/12/16 11:39:07
I would insert a constant class at this level:
cl
ahe
2014/12/16 11:58:50
Done.
|
| + const [ |
| + "main() { print('Hello, ", |
| + const ["", "Brave New "], |
| + "World!'); }", |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['Hello, World!']), |
| + const ProgramExpectation( |
| + const <String>['Hello, Brave New World!']), |
| + ], |
| ], |
| // Test that the test framework handles more than one update. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| - "main() { print('Hello darkness, my old friend'); }", |
| - const <String> ['Hello darkness, my old friend']), |
| - const ProgramResult( |
| - "main() { print('I\\'ve come to talk with you again'); }", |
| - const <String> ['I\'ve come to talk with you again']), |
| - const ProgramResult( |
| - "main() { print('Because a vision softly creeping'); }", |
| - const <String> ['Because a vision softly creeping']), |
| + const [ |
| + const [ |
| + "main() { print('", |
| + const [ |
| + "Hello darkness, my old friend", |
| + "I\\'ve come to talk with you again", |
| + "Because a vision softly creeping", |
| + ], |
| + "'); }", |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['Hello darkness, my old friend']), |
| + const ProgramExpectation( |
| + const <String>['I\'ve come to talk with you again']), |
| + const ProgramExpectation( |
| + const <String>['Because a vision softly creeping']), |
| + ], |
| ], |
| // Test that that isolate support works. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| - "main(arguments) { print('Hello, Isolated World!'); }", |
| - const <String> ['Hello, Isolated World!']), |
| - const ProgramResult( |
| - "main(arguments) { print(arguments); }", |
| - const <String> ['[]']), |
| + const [ |
| + const [ |
| + "main(arguments) { print(", |
| + const [ |
| + "'Hello, Isolated World!'", |
| + "arguments" |
| + ], |
| + "); }", |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['Hello, Isolated World!']), |
| + const ProgramExpectation( |
| + const <String>['[]']), |
| + ], |
| ], |
| - // Test that a stored closure changes behavior when updated. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that a stored closure changes behavior when updated. |
| + |
| var closure; |
| foo(a, [b = 'b']) { |
| - print('$a $b'); |
| -} |
| - |
| -main() { |
| - if (closure == null) { |
| - print('[closure] is null.'); |
| - closure = foo; |
| - } |
| - closure('a'); |
| - closure('a', 'c'); |
| -} |
| """, |
| - const <String> ['[closure] is null.', 'a b', 'a c']), |
| - const ProgramResult( |
| + const [ |
| + r"print('$a $b');", |
| + r"print('$b $a');", |
| + ], |
| r""" |
| -var closure; |
| - |
| -foo(a, [b = 'b']) { |
| - print('$b $a'); |
| } |
| main() { |
| @@ -114,62 +123,56 @@ main() { |
| closure('a'); |
| closure('a', 'c'); |
| } |
| -""", |
| - const <String> ['b a', 'c a']), |
| +"""], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['[closure] is null.', 'a b', 'a c']), |
| + const ProgramExpectation( |
| + const <String>['b a', 'c a']), |
| + ], |
| ], |
| - // Test modifying a static method works. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| """ |
| +// Test modifying a static method works. |
| + |
| class C { |
| static m() { |
| - print('v1'); |
| - } |
| -} |
| -main() { |
| - C.m(); |
| -} |
| """, |
| - const <String> ['v1']), |
| - const ProgramResult( |
| + const [ |
| + "print('v1');", |
| + "print('v2');", |
| + ], |
| """ |
| -class C { |
| - static m() { |
| - print('v2'); |
| } |
| } |
| main() { |
| C.m(); |
| } |
| """, |
| - const <String> ['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test modifying an instance method works. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| """ |
| +// Test modifying an instance method works. |
| + |
| class C { |
| m() { |
| - print('v1'); |
| - } |
| -} |
| -var instance; |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new C(); |
| - } |
| - instance.m(); |
| -} |
| """, |
| - const <String> ['instance is null', 'v1']), |
| - const ProgramResult( |
| + const [ |
| + "print('v1');", |
| + "print('v2');", |
| + ], |
| """ |
| -class C { |
| - m() { |
| - print('v2'); |
| } |
| } |
| var instance; |
| @@ -181,33 +184,29 @@ main() { |
| instance.m(); |
| } |
| """, |
| - const <String> ['v2']), |
| + |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that a stored instance tearoff changes behavior when updated. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| """ |
| +// Test that a stored instance tearoff changes behavior when updated. |
| + |
| class C { |
| m() { |
| - print('v1'); |
| - } |
| -} |
| -var closure; |
| -main() { |
| - if (closure == null) { |
| - print('closure is null'); |
| - closure = new C().m; |
| - } |
| - closure(); |
| -} |
| """, |
| - const <String> ['closure is null', 'v1']), |
| - const ProgramResult( |
| - """ |
| -class C { |
| - m() { |
| - print('v2'); |
| + const [ |
| + "print('v1');", |
| + "print('v2');", |
| + ], |
| + """ |
| } |
| } |
| var closure; |
| @@ -219,35 +218,33 @@ main() { |
| closure(); |
| } |
| """, |
| - const <String> ['v2']), |
| + |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['closure is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that deleting an instance method works. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| """ |
| +// Test that deleting an instance method works. |
| + |
| class C { |
| +""", |
| + const [ |
| + """ |
| m() { |
| print('v1'); |
| } |
| -} |
| -var instance; |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new C(); |
| - } |
| - try { |
| - instance.m(); |
| - } catch (e) { |
| - print('threw'); |
| - } |
| -} |
| """, |
| - const <String> ['instance is null', 'v1']), |
| - const ProgramResult( |
| + """ |
| +""", |
| + ], |
| """ |
| -class C { |
| } |
| var instance; |
| main() { |
| @@ -262,47 +259,38 @@ main() { |
| } |
| } |
| """, |
| - const <String> ['threw']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['threw']), |
| + ], |
| ], |
| - // Test that deleting an instance method works, even when accessed through |
| - // super. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| """ |
| +// Test that deleting an instance method works, even when accessed through |
| +// super. |
| + |
| class A { |
| m() { |
| print('v2'); |
| } |
| } |
| class B extends A { |
| +""", |
| + const [ |
| + """ |
| m() { |
| print('v1'); |
| } |
| -} |
| -class C extends B { |
| - m() { |
| - super.m(); |
| - } |
| -} |
| -var instance; |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new C(); |
| - } |
| - instance.m(); |
| -} |
| """, |
| - const <String> ['instance is null', 'v1']), |
| - const ProgramResult( |
| + """ |
| +""", |
| + ], |
| """ |
| -class A { |
| - m() { |
| - print('v2'); |
| - } |
| -} |
| -class B extends A { |
| } |
| class C extends B { |
| m() { |
| @@ -318,36 +306,31 @@ main() { |
| instance.m(); |
| } |
| """, |
| - const <String> ['v2']), |
| + |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that deleting a top-level method works. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| """ |
| +// Test that deleting a top-level method works. |
| + |
| +""", |
| + const [ |
| + """ |
| toplevel() { |
| print('v1'); |
| } |
| -class C { |
| - m() { |
| - try { |
| - toplevel(); |
| - } catch (e) { |
| - print('threw'); |
| - } |
| - } |
| -} |
| -var instance; |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new C(); |
| - } |
| - instance.m(); |
| -} |
| """, |
| - const <String> ['instance is null', 'v1']), |
| - const ProgramResult( |
| + """ |
| +""", |
| + ], |
| """ |
| class C { |
| m() { |
| @@ -367,47 +350,32 @@ main() { |
| instance.m(); |
| } |
| """, |
| - const <String> ['threw']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['threw']), |
| + ], |
| ], |
| - // Test that deleting a static method works. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| """ |
| +// Test that deleting a static method works. |
| + |
| class B { |
| +""", |
| + const [ |
| + """ |
| static staticMethod() { |
| print('v1'); |
| } |
| -} |
| -class C { |
| - m() { |
| - try { |
| - B.staticMethod(); |
| - } catch (e) { |
| - print('threw'); |
| - } |
| - try { |
| - // Ensure that noSuchMethod support is compiled. This test is not about |
| - // adding new classes. |
| - B.missingMethod(); |
| - print('bad'); |
| - } catch (e) { |
| - } |
| - } |
| -} |
| -var instance; |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new C(); |
| - } |
| - instance.m(); |
| -} |
| """, |
| - const <String> ['instance is null', 'v1']), |
| - const ProgramResult( |
| - """ |
| -class B { |
| + """ |
| +""", |
| + ], |
| + """ |
| } |
| class C { |
| m() { |
| @@ -434,37 +402,20 @@ main() { |
| instance.m(); |
| } |
| """, |
| - const <String> ['threw']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['threw']), |
| + ], |
| ], |
| - // Test that a newly instantiated class is handled. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| """ |
| -class A { |
| - m() { |
| - print('Called A.m'); |
| - } |
| -} |
| - |
| -class B { |
| - m() { |
| - print('Called B.m'); |
| - } |
| -} |
| +// Test that a newly instantiated class is handled. |
| -var instance; |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new A(); |
| - } |
| - instance.m(); |
| -} |
| -""", |
| - const <String>['instance is null', 'Called A.m']), |
| - const ProgramResult( |
| - """ |
| class A { |
| m() { |
| print('Called A.m'); |
| @@ -482,64 +433,63 @@ main() { |
| if (instance == null) { |
| print('instance is null'); |
| instance = new A(); |
| +""", |
| + const [ |
| + """ |
| +""", |
| + """ |
| } else { |
| instance = new B(); |
| +""", |
| + ], |
| + """ |
| } |
| instance.m(); |
| } |
| """, |
| - const <String>['Called B.m']), |
| + |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'Called A.m']), |
| + const ProgramExpectation( |
| + const <String>['Called B.m']), |
| + ], |
| ], |
| - // Test that source maps don't throw exceptions. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| """ |
| -main() { |
| - print('a'); |
| -} |
| -""", |
| - const <String>['a']), |
| +// Test that source maps don't throw exceptions. |
| - const ProgramResult( |
| - """ |
| main() { |
| print('a'); |
| +""", |
| + const [ |
| + """ |
| +""", |
| + """ |
| print('b'); |
| print('c'); |
| +""", |
| + ], |
| + """ |
| } |
| """, |
| - const <String>['a', 'b', 'c']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['a']), |
| + const ProgramExpectation( |
| + const <String>['a', 'b', 'c']), |
| + ], |
| ], |
| - // Test that a newly instantiated class is handled. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| -class A { |
| - get name => 'A.m'; |
| +// Test that a newly instantiated class is handled. |
| - m() { |
| - print('Called $name'); |
| - } |
| -} |
| - |
| -class B extends A { |
| - get name => 'B.m'; |
| -} |
| - |
| -var instance; |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new A(); |
| - } |
| - instance.m(); |
| -} |
| -""", |
| - const <String>['instance is null', 'Called A.m']), |
| - const ProgramResult( |
| - r""" |
| class A { |
| get name => 'A.m'; |
| @@ -557,19 +507,34 @@ main() { |
| if (instance == null) { |
| print('instance is null'); |
| instance = new A(); |
| +""", |
| + const [ |
| + r""" |
| +""", |
| + r""" |
| } else { |
| instance = new B(); |
| +""", |
| + ], |
| + r""" |
| } |
| instance.m(); |
| } |
| """, |
| - const <String>['Called B.m']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'Called A.m']), |
| + const ProgramExpectation( |
| + const <String>['Called B.m']), |
| + ], |
| ], |
| - // Test that fields of a newly instantiated class are handled. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that fields of a newly instantiated class are handled. |
| + |
| class A { |
| var x; |
| A(this.x); |
| @@ -583,51 +548,42 @@ foo() { |
| } |
| } |
| main() { |
| - foo(); |
| -} |
| """, |
| - const <String>['v1']), |
| - const ProgramResult( |
| - r""" |
| -class A { |
| - var x; |
| - A(this.x); |
| -} |
| -var instance; |
| -foo() { |
| - if (instance != null) { |
| - print(instance.x); |
| - } else { |
| - print('v1'); |
| - } |
| -} |
| -main() { |
| + const [ |
| + r""" |
| +""", |
| + r""" |
| instance = new A('v2'); |
| +""", |
| + ], |
| + r""" |
| foo(); |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that top-level functions can be added. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| -main() { |
| - try { |
| - foo(); |
| - } catch(e) { |
| - print('threw'); |
| - } |
| -} |
| +// Test that top-level functions can be added. |
| + |
| """, |
| - const <String>['threw']), |
| - const ProgramResult( |
| - r""" |
| + const [ |
| + "", |
| + r""" |
| foo() { |
| print('v2'); |
| } |
| - |
| +""", |
| + ], |
| + r""" |
| main() { |
| try { |
| foo(); |
| @@ -636,31 +592,31 @@ main() { |
| } |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['threw']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that static methods can be added. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| -class C { |
| -} |
| +// Test that static methods can be added. |
| -main() { |
| - try { |
| - C.foo(); |
| - } catch(e) { |
| - print('threw'); |
| - } |
| -} |
| -""", |
| - const <String>['threw']), |
| - const ProgramResult( |
| - r""" |
| class C { |
| +""", |
| + const [ |
| + "", |
| + r""" |
| static foo() { |
| print('v2'); |
| } |
| +""", |
| + ], |
| + r""" |
| } |
| main() { |
| @@ -671,38 +627,32 @@ main() { |
| } |
| } |
| """, |
| - const <String>['v2']), |
| + |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['threw']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that instance methods can be added. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| -class C { |
| -} |
| +// Test that instance methods can be added. |
| -var instance; |
| - |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new C(); |
| - } |
| - |
| - try { |
| - instance.foo(); |
| - } catch(e) { |
| - print('threw'); |
| - } |
| -} |
| -""", |
| - const <String>['instance is null', 'threw']), |
| - const ProgramResult( |
| - r""" |
| class C { |
| +""", |
| + const [ |
| + "", |
| + r""" |
| foo() { |
| print('v2'); |
| } |
| +""", |
| + ], |
| + r""" |
| } |
| var instance; |
| @@ -720,55 +670,65 @@ main() { |
| } |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'threw']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that top-level functions can have signature changed. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that top-level functions can have signature changed. |
| + |
| +""", |
| + const [ |
| + r""" |
| foo() { |
| print('v1'); |
| -} |
| - |
| -main() { |
| - foo(); |
| -} |
| """, |
| - const <String>['v1']), |
| - const ProgramResult( |
| - r""" |
| + r""" |
| void foo() { |
| print('v2'); |
| +""", |
| + ], |
| + r""" |
| } |
| main() { |
| foo(); |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that static methods can have signature changed. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that static methods can have signature changed. |
| + |
| class C { |
| +""", |
| + const [ |
| + r""" |
| static foo() { |
| print('v1'); |
| - } |
| -} |
| - |
| -main() { |
| - C.foo(); |
| -} |
| """, |
| - const <String>['v1']), |
| - const ProgramResult( |
| - r""" |
| -class C { |
| + r""" |
| static void foo() { |
| print('v2'); |
| +""", |
| + ], |
| + r""" |
| } |
| } |
| @@ -776,36 +736,33 @@ main() { |
| C.foo(); |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that instance methods can have signature changed. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that instance methods can have signature changed. |
| + |
| class C { |
| +""", |
| + const [ |
| + r""" |
| foo() { |
| print('v1'); |
| - } |
| -} |
| - |
| -var instance; |
| - |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new C(); |
| - } |
| - |
| - instance.foo(); |
| -} |
| """, |
| - const <String>['instance is null', 'v1']), |
| - const ProgramResult( |
| - r""" |
| -class C { |
| + r""" |
| void foo() { |
| print('v2'); |
| +""", |
| + ], |
| + r""" |
| } |
| } |
| @@ -820,51 +777,67 @@ main() { |
| instance.foo(); |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that adding a class is supported. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| -main() { |
| - print('v1'); |
| -} |
| + // Test that adding a class is supported. |
| + |
| """, |
| - const <String>['v1']), |
| - const ProgramResult( |
| - r""" |
| + const [ |
| + "", |
| + r""" |
| class C { |
| void foo() { |
| print('v2'); |
| } |
| } |
| - |
| +""", |
| + ], |
| + r""" |
| main() { |
| +""", |
| + const [ |
| + r""" |
| + print('v1'); |
| +""", |
| + r""" |
| new C().foo(); |
| +""", |
| + ], |
| + r""" |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that removing a class is supported, using constructor. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| -class C { |
| -} |
| +// Test that removing a class is supported, using constructor. |
| -main() { |
| - try { |
| - new C(); |
| - print('v1'); |
| - } catch (e) { |
| - print('v2'); |
| - } |
| +""", |
| + const [ |
| + r""" |
| +class C { |
| } |
| """, |
| - const <String>['v1']), |
| - const ProgramResult( |
| + "" |
| + ], |
| r""" |
| main() { |
| try { |
| @@ -875,29 +848,31 @@ main() { |
| } |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that removing a class is supported, using a static method. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that removing a class is supported, using a static method. |
| + |
| +""", |
| + const [ |
| + r""" |
| class C { |
| static m() { |
| print('v1'); |
| } |
| } |
| - |
| -main() { |
| - try { |
| - C.m(); |
| - } catch (e) { |
| - print('v2'); |
| - } |
| -} |
| """, |
| - const <String>['v1']), |
| - const ProgramResult( |
| + "", |
| + ], |
| r""" |
| main() { |
| try { |
| @@ -907,13 +882,20 @@ main() { |
| } |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that changing the supertype of a class. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that changing the supertype of a class. |
| + |
| class A { |
| m() { |
| print('v2'); |
| @@ -924,36 +906,16 @@ class B extends A { |
| print('v1'); |
| } |
| } |
| +""", |
| + const [ |
| + r""" |
| class C extends B { |
| - m() { |
| - super.m(); |
| - } |
| -} |
| - |
| -var instance; |
| - |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new C(); |
| - } |
| - instance.m(); |
| -} |
| """, |
| - const <String>['instance is null', 'v1']), |
| - const ProgramResult( |
| - r""" |
| -class A { |
| - m() { |
| - print('v2'); |
| - } |
| -} |
| -class B extends A { |
| - m() { |
| - print('v1'); |
| - } |
| -} |
| + r""" |
| class C extends A { |
| +""", |
| + ], |
| + r""" |
| m() { |
| super.m(); |
| } |
| @@ -969,40 +931,27 @@ main() { |
| instance.m(); |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test adding a field to a class works. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| -class A { |
| -} |
| +// Test adding a field to a class works. |
| -var instance; |
| - |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new A(); |
| - } |
| - try { |
| - instance.x = 'v2'; |
| - } catch(e) { |
| - print('setter threw'); |
| - } |
| - try { |
| - print(instance.x); |
| - } catch (e) { |
| - print('getter threw'); |
| - } |
| -} |
| +class A { |
| """, |
| - const <String>['instance is null', 'setter threw', 'getter threw']), |
| - const ProgramResult( |
| + const [ |
| + "", |
| + "var x;", |
| + ], |
| r""" |
| -class A { |
| - var x; |
| } |
| var instance; |
| @@ -1024,40 +973,27 @@ main() { |
| } |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'setter threw', 'getter threw']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test removing a field from a class works. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| -class A { |
| - var x; |
| -} |
| - |
| -var instance; |
| +// Test removing a field from a class works. |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new A(); |
| - } |
| - try { |
| - instance.x = 'v1'; |
| - } catch(e) { |
| - print('setter threw'); |
| - } |
| - try { |
| - print(instance.x); |
| - } catch (e) { |
| - print('getter threw'); |
| - } |
| -} |
| +class A { |
| """, |
| - const <String>['instance is null', 'v1']), |
| - const ProgramResult( |
| + const [ |
| + "var x;", |
| + "", |
| + ], |
| r""" |
| -class A { |
| } |
| var instance; |
| @@ -1079,13 +1015,20 @@ main() { |
| } |
| } |
| """, |
| - const <String>['setter threw', 'getter threw']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['setter threw', 'getter threw']), |
| + ], |
| ], |
| - // Test that named arguments can be called. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that named arguments can be called. |
| + |
| class C { |
| foo({a, named: 'v1', x}) { |
| print(named); |
| @@ -1099,54 +1042,32 @@ main() { |
| print('instance is null'); |
| instance = new C(); |
| } |
| +""", |
| + const [ |
| + r""" |
| instance.foo(); |
| -} |
| """, |
| - const <String>['instance is null', 'v1']), |
| - const ProgramResult( |
| - r""" |
| -class C { |
| - foo({a, named: 'v1', x}) { |
| - print(named); |
| - } |
| -} |
| - |
| -var instance; |
| - |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new C(); |
| - } |
| + r""" |
| instance.foo(named: 'v2'); |
| +""", |
| + ], |
| + r""" |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test than named arguments can be called. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| -class C { |
| - foo({a, named: 'v2', x}) { |
| - print(named); |
| - } |
| -} |
| +// Test than named arguments can be called. |
| -var instance; |
| - |
| -main() { |
| - if (instance == null) { |
| - print('instance is null'); |
| - instance = new C(); |
| - } |
| - instance.foo(named: 'v1'); |
| -} |
| -""", |
| - const <String>['instance is null', 'v1']), |
| - const ProgramResult( |
| - r""" |
| class C { |
| foo({a, named: 'v2', x}) { |
| print(named); |
| @@ -1160,35 +1081,32 @@ main() { |
| print('instance is null'); |
| instance = new C(); |
| } |
| - instance.foo(); |
| -} |
| """, |
| - const <String>['v2']), |
| - ], |
| - |
| - // Test that an instance tear-off with named parameters can be called. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| - r""" |
| -class C { |
| - foo({a, named: 'v1', x}) { |
| - print(named); |
| - } |
| -} |
| - |
| -var closure; |
| - |
| -main() { |
| - if (closure == null) { |
| - print('closure is null'); |
| - closure = new C().foo; |
| - } |
| - closure(); |
| + const [ |
| + r""" |
| + instance.foo(named: 'v1'); |
| +""", |
| + r""" |
| + instance.foo(); |
| +""", |
| + ], |
| + r""" |
| } |
| """, |
| - const <String>['closure is null', 'v1']), |
| - const ProgramResult( |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['instance is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| + ], |
| + |
| + const [ |
| + const [ |
| r""" |
| +// Test that an instance tear-off with named parameters can be called. |
| + |
| class C { |
| foo({a, named: 'v1', x}) { |
| print(named); |
| @@ -1202,36 +1120,42 @@ main() { |
| print('closure is null'); |
| closure = new C().foo; |
| } |
| +""", |
| + const [ |
| + r""" |
| + closure(); |
| +""", |
| + r""" |
| closure(named: 'v2'); |
| +""", |
| + ], |
| + r""" |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['closure is null', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that a lazy static is supported. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that a lazy static is supported. |
| + |
| var normal; |
| +""", |
| + const [ |
| + r""" |
| foo() { |
| print(normal); |
| } |
| - |
| -main() { |
| - if (normal == null) { |
| - normal = 'v1'; |
| - } else { |
| - normal = ''; |
| - } |
| - foo(); |
| -} |
| """, |
| - const <String>['v1']), |
| - const ProgramResult( |
| - r""" |
| -var normal; |
| - |
| + r""" |
| var lazy = bar(); |
| foo() { |
| @@ -1243,6 +1167,9 @@ bar() { |
| return 'lazy'; |
| } |
| +""", |
| + ], |
| + r""" |
| main() { |
| if (normal == null) { |
| normal = 'v1'; |
| @@ -1252,14 +1179,19 @@ main() { |
| foo(); |
| } |
| """, |
| - const <String>['v2', 'lazy']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2', 'lazy']), |
| + ], |
| ], |
| - // Test that superclasses of directly instantiated classes are also |
| - // emitted. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that superclasses of directly instantiated classes are also emitted. |
| class A { |
| } |
| @@ -1267,49 +1199,61 @@ class B extends A { |
| } |
| main() { |
| +""", |
| + const [ |
| + r""" |
| print('v1'); |
| -} |
| """, |
| - const <String>['v1']), |
| - const ProgramResult( |
| - r""" |
| -class A { |
| -} |
| - |
| -class B extends A { |
| -} |
| - |
| -main() { |
| + r""" |
| new B(); |
| print('v2'); |
| +""", |
| + ], |
| + r""" |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that interceptor classes are handled correctly. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that interceptor classes are handled correctly. |
| + |
| main() { |
| +""", |
| + const [ |
| + r""" |
| print('v1'); |
| -} |
| """, |
| - const <String>['v1']), |
| - const ProgramResult( |
| - r""" |
| -main() { |
| + r""" |
| ['v2'].forEach(print); |
| +""", |
| + ], |
| + r""" |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that newly instantiated classes are handled correctly when there is |
| - // more than one change. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that newly instantiated superclasses are handled correctly when there |
| +// is more than one change. |
| + |
| class A { |
| foo() { |
| print('Called foo'); |
| @@ -1324,32 +1268,38 @@ class B extends A { |
| } |
| main() { |
| +""", |
| + const [ |
| + r""" |
| new B().foo(); |
| -} |
| """, |
| - const <String>['Called foo']), |
| - const ProgramResult( |
| - r""" |
| -class A { |
| - foo() { |
| - print('Called foo'); |
| - } |
| - |
| - bar() { |
| - print('Called bar'); |
| - } |
| -} |
| - |
| -class B extends A { |
| -} |
| - |
| -main() { |
| + r""" |
| new B().foo(); |
| +""", |
| + r""" |
| + new A().bar(); |
| +""", |
| + ], |
| + r""" |
| } |
| """, |
| - const <String>['Called foo']), |
| - const ProgramResult( |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['Called foo']), |
| + const ProgramExpectation( |
| + const <String>['Called foo']), |
| + const ProgramExpectation( |
| + const <String>['Called bar']), |
| + ], |
| + ], |
| + |
| + const [ |
| + const [ |
| r""" |
| +// Test that newly instantiated subclasses are handled correctly when there is |
| +// more than one change. |
| + |
| class A { |
| foo() { |
| print('Called foo'); |
| @@ -1364,76 +1314,80 @@ class B extends A { |
| } |
| main() { |
| - new A().bar(); |
| +""", |
| + const [ |
| + r""" |
| + new A().foo(); |
| +""", |
| + r""" |
| + new A().foo(); |
| +""", |
| + r""" |
| + new B().bar(); |
| +""", |
| + ], |
| + r""" |
| } |
| """, |
| - const <String>['Called bar']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['Called foo']), |
| + const ProgramExpectation( |
| + const <String>['Called foo']), |
| + const ProgramExpectation( |
| + const <String>['Called bar']), |
| + ], |
| ], |
| - // Test that constants are handled correctly. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that constants are handled correctly. |
| + |
| class C { |
| final String value; |
| const C(this.value); |
| } |
| main() { |
| +""", |
| + const [ |
| + r""" |
| print(const C('v1').value); |
| -} |
| """, |
| - const <String>['v1']), |
| - const ProgramResult( |
| - r""" |
| -class C { |
| - final String value; |
| - const C(this.value); |
| -} |
| - |
| -main() { |
| + r""" |
| print(const C('v2').value); |
| +""", |
| + ], |
| + r""" |
| } |
| """, |
| - const <String>['v2']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['v1']), |
| + const ProgramExpectation( |
| + const <String>['v2']), |
| + ], |
| ], |
| - // Test that an instance field can be added to a compound declaration. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that an instance field can be added to a compound declaration. |
| + |
| class C { |
| +""", |
| + const [ |
| + r""" |
| int x; |
| -} |
| - |
| -var instance; |
| - |
| -main() { |
| - if (instance == null) { |
| - print('[instance] is null'); |
| - instance = new C(); |
| - instance.x = 'v1'; |
| - } else { |
| - instance.y = 'v2'; |
| - } |
| - try { |
| - print(instance.x); |
| - } catch (e) { |
| - print('[instance.x] threw'); |
| - } |
| - try { |
| - print(instance.y); |
| - } catch (e) { |
| - print('[instance.y] threw'); |
| - } |
| -} |
| """, |
| - const <String>['[instance] is null', 'v1', '[instance.y] threw']), |
| - |
| - const ProgramResult( |
| - r""" |
| -class C { |
| + r""" |
| int x, y; |
| +""", |
| + ], |
| + r""" |
| } |
| var instance; |
| @@ -1458,47 +1412,34 @@ main() { |
| } |
| } |
| """, |
| - const <String>['v1', 'v2'], |
| - // TODO(ahe): Shouldn't throw. |
| - compileUpdatesShouldThrow: true), |
| - |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>[ |
| + '[instance] is null', 'v1', '[instance.y] threw']), |
| + const ProgramExpectation( |
| + const <String>['v1', 'v2'], |
| + // TODO(ahe): Shouldn't throw. |
| + compileUpdatesShouldThrow: true), |
| + ], |
| ], |
| - // Test that an instance field can be removed from a compound declaration. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that an instance field can be removed from a compound declaration. |
| + |
| class C { |
| +""", |
| + const [ |
| + r""" |
| int x, y; |
| -} |
| - |
| -var instance; |
| - |
| -main() { |
| - if (instance == null) { |
| - print('[instance] is null'); |
| - instance = new C(); |
| - instance.x = 'v1'; |
| - instance.y = 'v2'; |
| - } |
| - try { |
| - print(instance.x); |
| - } catch (e) { |
| - print('[instance.x] threw'); |
| - } |
| - try { |
| - print(instance.y); |
| - } catch (e) { |
| - print('[instance.y] threw'); |
| - } |
| -} |
| """, |
| - const <String>['[instance] is null', 'v1', 'v2']), |
| - |
| - const ProgramResult( |
| - r""" |
| -class C { |
| + r""" |
| int x; |
| +""", |
| + ], |
| + r""" |
| } |
| var instance; |
| @@ -1522,48 +1463,34 @@ main() { |
| } |
| } |
| """, |
| - const <String>['v1', '[instance.y] threw'], |
| - // TODO(ahe): Shouldn't throw. |
| - compileUpdatesShouldThrow: true), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['[instance] is null', 'v1', 'v2']), |
| + const ProgramExpectation( |
| + const <String>['v1', '[instance.y] threw'], |
| + // TODO(ahe): Shouldn't throw. |
| + compileUpdatesShouldThrow: true), |
| + ], |
| ], |
| - // Test that a static field can be made an instance field. |
| - // TODO(ahe): Test doesn't pass. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| -class C { |
| - static int x; |
| -} |
| - |
| -var instance; |
| +// Test that a static field can be made an instance field. |
| -main() { |
| - if (instance == null) { |
| - print('[instance] is null'); |
| - instance = new C(); |
| - C.x = 'v1'; |
| - } else { |
| - instance.x = 'v2'; |
| - } |
| - try { |
| - print(C.x); |
| - } catch (e) { |
| - print('[C.x] threw'); |
| - } |
| - try { |
| - print(instance.x); |
| - } catch (e) { |
| - print('[instance.x] threw'); |
| - } |
| -} |
| +class C { |
| """, |
| - const <String>['[instance] is null', 'v1', '[instance.x] threw']), |
| - const ProgramResult( |
| - r""" |
| -class C { |
| + const [ |
| + r""" |
| + static int x; |
| +""", |
| + r""" |
| int x; |
| +""", |
| + ], |
| + r""" |
| } |
| var instance; |
| @@ -1588,47 +1515,33 @@ main() { |
| } |
| } |
| """, |
| - const <String>['[C.x] threw', 'v2'], |
| - // TODO(ahe): Shouldn't throw. |
| - compileUpdatesShouldThrow: true), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['[instance] is null', 'v1', '[instance.x] threw']), |
| + const ProgramExpectation( |
| + const <String>['[C.x] threw', 'v2'], |
| + // TODO(ahe): Shouldn't throw. |
| + compileUpdatesShouldThrow: true), |
| + ], |
| ], |
| - // Test that instance field can be made static. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test that instance field can be made static. |
| + |
| class C { |
| +""", |
| + const [ |
| + r""" |
| int x; |
| -} |
| - |
| -var instance; |
| - |
| -main() { |
| - if (instance == null) { |
| - print('[instance] is null'); |
| - instance = new C(); |
| - instance.x = 'v1'; |
| - } else { |
| - C.x = 'v2'; |
| - } |
| - try { |
| - print(C.x); |
| - } catch (e) { |
| - print('[C.x] threw'); |
| - } |
| - try { |
| - print(instance.x); |
| - } catch (e) { |
| - print('[instance.x] threw'); |
| - } |
| -} |
| """, |
| - const <String>['[instance] is null', '[C.x] threw', 'v1']), |
| - |
| - const ProgramResult( |
| - r""" |
| -class C { |
| + r""" |
| static int x; |
| +""", |
| + ], |
| + r""" |
| } |
| var instance; |
| @@ -1653,15 +1566,22 @@ main() { |
| } |
| } |
| """, |
| - const <String>['v2', '[instance.x] threw'], |
| - // TODO(ahe): Shouldn't throw. |
| - compileUpdatesShouldThrow: true), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['[instance] is null', '[C.x] threw', 'v1']), |
| + const ProgramExpectation( |
| + const <String>['v2', '[instance.x] threw'], |
| + // TODO(ahe): Shouldn't throw. |
| + compileUpdatesShouldThrow: true), |
| + ], |
| ], |
| - // Test compound constants. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test compound constants. |
| + |
| class A { |
| final value; |
| const A(this.value); |
| @@ -1677,62 +1597,44 @@ class B { |
| } |
| main() { |
| +""", |
| + const [ |
| + r""" |
| print(const A('v1')); |
| print(const B('v1')); |
| -} |
| """, |
| - const <String>['A(v1)', 'B(v1)']), |
| - |
| - const ProgramResult( |
| - r""" |
| -class A { |
| - final value; |
| - const A(this.value); |
| - |
| - toString() => 'A($value)'; |
| -} |
| - |
| -class B { |
| - final value; |
| - const B(this.value); |
| - |
| - toString() => 'B($value)'; |
| -} |
| - |
| -main() { |
| + r""" |
| print(const B(const A('v2'))); |
| print(const A(const B('v2'))); |
| -} |
| """, |
| - const <String>['B(A(v2))', 'A(B(v2))']), |
| - ], |
| - |
| - // Test constants of new classes. |
| - const <ProgramResult>[ |
| - const ProgramResult( |
| + ], |
| r""" |
| -class A { |
| - final value; |
| - const A(this.value); |
| - |
| - toString() => 'A($value)'; |
| -} |
| - |
| -main() { |
| - print(const A('v1')); |
| } |
| """, |
| - const <String>['A(v1)']), |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['A(v1)', 'B(v1)']), |
| + const ProgramExpectation( |
| + const <String>['B(A(v2))', 'A(B(v2))']), |
| + ], |
| + ], |
| - const ProgramResult( |
| + const [ |
| + const [ |
| r""" |
| +// Test constants of new classes. |
| + |
| class A { |
| final value; |
| const A(this.value); |
| toString() => 'A($value)'; |
| } |
| - |
| +""", |
| + const [ |
| + "", |
| + r""" |
| class B { |
| final value; |
| const B(this.value); |
| @@ -1740,14 +1642,34 @@ class B { |
| toString() => 'B($value)'; |
| } |
| +""", |
| + ], |
| + r""" |
| main() { |
| +""", |
| + |
| + const [ |
| + r""" |
| + print(const A('v1')); |
| +""", |
| + r""" |
| print(const A('v2')); |
| print(const B('v2')); |
| print(const B(const A('v2'))); |
| print(const A(const B('v2'))); |
| +""", |
| + ], |
| + r""" |
| } |
| """, |
| - const <String>['A(v2)', 'B(v2)', 'B(A(v2))', 'A(B(v2))']), |
| + |
| + ], |
| + const <ProgramExpectation>[ |
| + const ProgramExpectation( |
| + const <String>['A(v1)']), |
| + const ProgramExpectation( |
| + const <String>['A(v2)', 'B(v2)', 'B(A(v2))', 'A(B(v2))']), |
| + ], |
| ], |
| ]; |
| @@ -1789,8 +1711,9 @@ void updateSummary(_) { |
| summary.text = " (${testCount - 1}/${tests.length})"; |
| } |
| -Future compileAndRun(List<ProgramResult> programs) { |
| +Future compileAndRun(List encodedResults) { |
| updateSummary(null); |
| + List<ProgramResult> programs = ProgramResult.decode(encodedResults); |
| var status = new DivElement(); |
| document.body.append(status); |