Index: test/codegen/corelib/list_last_test.dart |
diff --git a/test/codegen/language/interceptor3_test.dart b/test/codegen/corelib/list_last_test.dart |
similarity index 54% |
copy from test/codegen/language/interceptor3_test.dart |
copy to test/codegen/corelib/list_last_test.dart |
index a12172187ec342dba67ad1898a14b91c0aef9479..07333356b2ebcac84eff23085702c663971a6023 100644 |
--- a/test/codegen/language/interceptor3_test.dart |
+++ b/test/codegen/corelib/list_last_test.dart |
@@ -4,14 +4,17 @@ |
import "package:expect/expect.dart"; |
-// Test that code motion in the presence of interceptors work in dart2js. |
- |
-main() { |
- var a = [2, '2']; |
- var b = a[1]; |
- if (a[0] == 2 && b is String) { |
- Expect.isTrue(b.contains('2')); |
+void test(List list) { |
+ if (list.isEmpty) { |
+ Expect.throws(() => list.last, (e) => e is StateError); |
} else { |
- b.isEven(); |
+ Expect.equals(list[list.length - 1], list.last); |
} |
} |
+ |
+main() { |
+ test([1, 2, 3]); |
+ test(const ["foo", "bar"]); |
+ test([]); |
+ test(const []); |
+} |