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

Side by Side Diff: tests/language/src/ExpectTest.dart

Issue 10248007: test rename overhaul: step 8 - language tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 // Testing the Expect class.
5
6 class ExpectTest {
7
8 static testEquals(a) {
9 try {
10 Expect.equals("AB", a, "within testEquals");
11 } catch (Exception msg) {
12 print(msg);
13 return;
14 }
15 Expect.equals("AB", "${a}B");
16 throw "Expect.equals did not fail";
17 }
18
19 static testIsTrue(f) {
20 try {
21 Expect.isTrue(f);
22 } catch (Exception msg) {
23 print(msg);
24 return;
25 }
26 Expect.isFalse(f);
27 throw "Expect.isTrue did not fail";
28 }
29
30 static testIsFalse(t) {
31 try {
32 Expect.isFalse(t);
33 } catch (Exception msg) {
34 print(msg);
35 return;
36 }
37 Expect.isTrue(t);
38 throw "Expect.isFalse did not fail";
39 }
40
41 static testIdentical(a) {
42 var ab = "${a}B";
43 try {
44 Expect.identical("AB", ab);
45 } catch (Exception msg) {
46 print(msg);
47 return;
48 }
49 Expect.equals("AB", ab);
50 throw "Expect.identical did not fail";
51 }
52
53 static testFail() {
54 try {
55 Expect.fail("fail now");
56 } catch (Exception msg) {
57 print(msg);
58 return;
59 }
60 throw "Expect.fail did not fail";
61 }
62
63 static void testMain() {
64 testEquals("A");
65 testIsTrue(false);
66 testIsTrue(1);
67 testIsFalse(true);
68 testIsFalse(0);
69 testIdentical("A");
70 testFail();
71 }
72
73 }
74
75 main() {
76 ExpectTest.testMain();
77 }
OLDNEW
« no previous file with comments | « tests/language/src/ExecuteFinally9Test.dart ('k') | tests/language/src/ExtendTypeParameter2NegativeTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698