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

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

Issue 23721011: Remove testing of a non-specified behavior. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 // Test class literal expressions. 7 // Test class literal expressions.
8 8
9 class Class { 9 class Class {
10 static fisk() => 42; 10 static fisk() => 42;
(...skipping 30 matching lines...) Expand all
41 Expect.throws(() { Class[0]++; }, (e) => e is NoSuchMethodError); 41 Expect.throws(() { Class[0]++; }, (e) => e is NoSuchMethodError);
42 Expect.throws(() { Class.method(); }, (e) => e is NoSuchMethodError); 42 Expect.throws(() { Class.method(); }, (e) => e is NoSuchMethodError);
43 Expect.throws(() { Class.field; }, (e) => e is NoSuchMethodError); 43 Expect.throws(() { Class.field; }, (e) => e is NoSuchMethodError);
44 Expect.throws(() { var x = Class.method(); }, (e) => e is NoSuchMethodError); 44 Expect.throws(() { var x = Class.method(); }, (e) => e is NoSuchMethodError);
45 Expect.throws(() { var x = Class.field; }, (e) => e is NoSuchMethodError); 45 Expect.throws(() { var x = Class.field; }, (e) => e is NoSuchMethodError);
46 Expect.throws(() { foo(Class.method()); }, (e) => e is NoSuchMethodError); 46 Expect.throws(() { foo(Class.method()); }, (e) => e is NoSuchMethodError);
47 Expect.throws(() { foo(Class.field); }, (e) => e is NoSuchMethodError); 47 Expect.throws(() { foo(Class.field); }, (e) => e is NoSuchMethodError);
48 Expect.throws(() { Class / 3; }, (e) => e is NoSuchMethodError); 48 Expect.throws(() { Class / 3; }, (e) => e is NoSuchMethodError);
49 Expect.throws(() { Class += 3; }, (e) => e is NoSuchMethodError); 49 Expect.throws(() { Class += 3; }, (e) => e is NoSuchMethodError);
50 50
51 // Verify that a class literal is its runtimeType.
52 var obj = new Class();
53 Expect.identical(Class, obj.runtimeType);
54
55 // Verify that a class literal isn't a string literal. 51 // Verify that a class literal isn't a string literal.
56 Expect.notEquals(Class, "Class"); 52 Expect.notEquals(Class, "Class");
57 53
58 // Verify toString() works for class literals. 54 // Verify toString() works for class literals.
59 Expect.equals((Class).toString(), "Class"); 55 Expect.equals((Class).toString(), "Class");
60 var y = Class; 56 var y = Class;
61 Expect.equals(y.toString(), "Class"); 57 Expect.equals(y.toString(), "Class");
62 58
63 Expect.throws(() { Class.toString(); }, (e) => e is NoSuchMethodError); 59 Expect.throws(() { Class.toString(); }, (e) => e is NoSuchMethodError);
64 } 60 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698