OLD | NEW |
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 // Testing the Expect class. | 4 // Testing the Expect class. |
5 | 5 |
6 import "package:expect/expect.dart"; | |
7 | |
8 class ExpectTest { | 6 class ExpectTest { |
9 | 7 |
10 static testEquals(a) { | 8 static testEquals(a) { |
11 try { | 9 try { |
12 Expect.equals("AB", a, "within testEquals"); | 10 Expect.equals("AB", a, "within testEquals"); |
13 } on Exception catch (msg) { | 11 } on Exception catch (msg) { |
14 print(msg); | 12 print(msg); |
15 return; | 13 return; |
16 } | 14 } |
17 Expect.equals("AB", "${a}B"); | 15 Expect.equals("AB", "${a}B"); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 testIsFalse(0); | 68 testIsFalse(0); |
71 testIdentical("A"); | 69 testIdentical("A"); |
72 testFail(); | 70 testFail(); |
73 } | 71 } |
74 | 72 |
75 } | 73 } |
76 | 74 |
77 main() { | 75 main() { |
78 ExpectTest.testMain(); | 76 ExpectTest.testMain(); |
79 } | 77 } |
OLD | NEW |