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

Unified Diff: tests/language/static_field_test.dart

Issue 10541140: re-writes some static field negative tests for use with analyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: # Created 8 years, 6 months 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 | « tests/language/static_field2a_run_negative_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/static_field_test.dart
diff --git a/tests/language/static_field_test.dart b/tests/language/static_field_test.dart
index 3b8ce18768da321a47826bed9ea5a13fcf0ee27b..93e15ba53cc28cdde065041d2748b4349c5e0cab 100644
--- a/tests/language/static_field_test.dart
+++ b/tests/language/static_field_test.dart
@@ -62,7 +62,49 @@ class StaticFieldTest {
}
+class StaticField1RunNegativeTest {
+ static /// 01: static type warning, runtime error
+ var x;
+ static testMain() {
+ var foo = new StaticField1RunNegativeTest();
ahe 2012/06/13 14:27:24 Here I would say: print(x); to make sure x is "c
zundel 2012/06/13 15:15:43 Done.
+ var x = foo.x;
ahe 2012/06/13 14:27:24 I would put the /// comment on this line. Also, I
zundel 2012/06/13 15:15:43 Got rid of the shadowing, but left the other in pl
+ }
+}
+
+class StaticField1aRunNegativeTest {
+ static /// 02: static type warning, runtime error
+ void m() {}
+
+ static testMain() {
+ var foo = new StaticField1aRunNegativeTest();
+ var m = foo.m;
ahe 2012/06/13 14:27:24 Ditto. For all three remarks above.
+ }
+}
+
+class StaticField2RunNegativeTest {
+ static /// 03: static type warning, runtime error
+ var x;
+
+ static testMain() {
+ var foo = new StaticField2RunNegativeTest();
+ foo.x = 1;
ahe 2012/06/13 14:27:24 Ditto (all three).
+ }
+}
+
+class StaticField2aRunNegativeTest {
+ static void m() {} /// 04: static type warning, runtime error
+
+ static testMain() {
+ var foo = new StaticField2aRunNegativeTest();
+ foo.m = 1; /// 04:continued
ahe 2012/06/13 14:27:24 Ditto (all three).
zundel 2012/06/13 15:15:43 I'm not sure the original author of this test real
+ }
+}
+
main() {
StaticFieldTest.testMain();
InitializerTest.testStaticFieldInitialization();
+ StaticField1RunNegativeTest.testMain();
+ StaticField1aRunNegativeTest.testMain();
+ StaticField2RunNegativeTest.testMain();
+ StaticField2aRunNegativeTest.testMain();
}
« no previous file with comments | « tests/language/static_field2a_run_negative_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698