Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: dart/tests/try/web/incremental_compilation_update_test.dart

Issue 797643002: Test compound constants and constants of new classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dc6eb97743270c2297d7078427652444e1a375ae..fc9f238902a8218c158f9374a0b64dcdccb137b9 100644
--- a/dart/tests/try/web/incremental_compilation_update_test.dart
+++ b/dart/tests/try/web/incremental_compilation_update_test.dart
@@ -1655,6 +1655,102 @@ main() {
const <String>['v2', '[instance.x] threw']),
*/
],
+
+ // Test compound constants.
+ const <ProgramResult>[
+ 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() {
+ 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() {
+ print(const B(const A('v2')));
+ print(const A(const B('v2')));
+}
+""",
+ // TODO(ahe): Broken test, wrong output.
+ const <String>['B(null)', 'A(null)']),
+/* These are the correct expectations:
+ 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 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() {
+ print(const A('v2'));
+ print(const B('v2'));
+ print(const B(const A('v2')));
+ print(const A(const B('v2')));
+}
+""",
+ const <String>['A(v2)', 'B(v2)', 'B(A(v2))', 'A(B(v2))']),
+ ],
];
void main() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698