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

Unified Diff: tests/language/is_not_class2_test.dart

Issue 57133004: Complete latest spec changes regarding malformed types (see issue 14006). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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
Index: tests/language/is_not_class2_test.dart
===================================================================
--- tests/language/is_not_class2_test.dart (revision 29871)
+++ tests/language/is_not_class2_test.dart (working copy)
@@ -2,26 +2,25 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// Dart test program for catch that we expect a class after an 'is'. This is
-// not a negative test since 'aa' is a malformed type and therefore should be
-// treated as dynamic.
+import 'package:expect/expect.dart';
class A {
const A();
}
-class IsNotClass2NegativeTest {
- static testMain() {
- var a = new A();
- var aa = new A();
+main() {
+ var a = new A();
+ var aa = new A();
+ try {
if (a is aa) { // static warning
+ Expect.fail("this code should not execute");
return 0;
}
- return 0;
+ Expect.fail("this code should not execute");
+ } on TypeError catch(e) {
+ } catch (e) {
+ Expect.fail("the TypeError should have been caught above");
}
+ return 0;
}
-
-main() {
- IsNotClass2NegativeTest.testMain();
-}

Powered by Google App Engine
This is Rietveld 408576698