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

Side by Side Diff: dart/tests/language/is_not_class2_test.dart

Issue 60293003: Version 0.8.10.5 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Dart test program for catch that we expect a class after an 'is'. This is 5 // Dart test program for catch that we expect a class after an 'is'. 'aa' is a
6 // not a negative test since 'aa' is a malformed type and therefore should be 6 // malformed type and a type error should be thrown upon test.
7 // treated as dynamic. 7
8 import 'package:expect/expect.dart';
8 9
9 class A { 10 class A {
10 const A(); 11 const A();
11 } 12 }
12 13
13 class IsNotClass2NegativeTest { 14 class IsNotClass2NegativeTest {
14 static testMain() { 15 static testMain() {
15 var a = new A(); 16 var a = new A();
16 var aa = new A(); 17 var aa = new A();
17 18
18 if (a is aa) { // static warning 19 if (a is aa) { // static warning
19 return 0; 20 return 0;
20 } 21 }
21 return 0; 22 return 0;
22 } 23 }
23 } 24 }
24 25
25 main() { 26 main() {
26 IsNotClass2NegativeTest.testMain(); 27 Expect.throws(IsNotClass2NegativeTest.testMain, (e) => e is TypeError);
27 } 28 }
OLDNEW
« no previous file with comments | « dart/tests/language/instanceof3_test.dart ('k') | dart/tests/language/isnot_malformed_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698