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

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: Refactored shared test 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..63fed28e7d9420655dbd8a08b49b6f915a094e55 100644
--- a/tests/language/static_field_test.dart
+++ b/tests/language/static_field_test.dart
@@ -62,7 +62,54 @@ class StaticFieldTest {
}
+class StaticField1RunNegativeTest {
+ static /// 01: static type warning, runtime error
+ var x;
+ testMain() {
+ var foo = new StaticField1RunNegativeTest();
+ print(x); // to compile 'x'
ahe 2012/06/13 15:26:08 Not a proper sentence: first letter should be uppe
+ var result = foo.x;
+ }
+}
+
+class StaticField1aRunNegativeTest {
+ static /// 02: static type warning, runtime error
+ void m() {}
+
+ testMain() {
+ var foo = new StaticField1aRunNegativeTest();
+ print(m); // to compile 'm'
+ var result = foo.m;
+ }
+}
+
+class StaticField2RunNegativeTest {
+ static /// 03: static type warning, runtime error
+ var x;
+
+ testMain() {
+ var foo = new StaticField2RunNegativeTest();
+ print(x); // to compile 'x'
+ foo.x = 1;
+ }
+}
+
+class StaticField2aRunNegativeTest {
+ static /// 04: static type warning, runtime error
+ void m() {}
+
+ testMain() {
+ var foo = new StaticField2aRunNegativeTest();
+ print(m); // to compile 'm'
+ foo.m = 1; /// 04:continued
+ }
+}
+
main() {
StaticFieldTest.testMain();
InitializerTest.testStaticFieldInitialization();
+ new StaticField1RunNegativeTest().testMain();
+ new StaticField1aRunNegativeTest().testMain();
+ new StaticField2RunNegativeTest().testMain();
+ new 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