OLD | NEW |
(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 |
| 5 |
| 6 main() { |
| 7 for (int i = 0; i < 6000; i++) { |
| 8 Expect.isFalse(test1(5)); |
| 9 Expect.isTrue(test1(3)); |
| 10 |
| 11 Expect.isTrue(test2(5)); |
| 12 Expect.isFalse(test2(3)); |
| 13 |
| 14 Expect.isTrue(test2r(5)); |
| 15 Expect.isFalse(test2r(3)); |
| 16 |
| 17 Expect.isTrue(test3()); |
| 18 |
| 19 Expect.equals(2, test4(5)); |
| 20 Expect.equals(1, test4(3)); |
| 21 |
| 22 Expect.equals(1, test5(5)); |
| 23 Expect.equals(2, test5(3)); |
| 24 |
| 25 Expect.equals(1, test6()); |
| 26 } |
| 27 } |
| 28 |
| 29 |
| 30 test1(a) { |
| 31 return a === 3; |
| 32 } |
| 33 |
| 34 test2(a) { |
| 35 return a !== 3; |
| 36 } |
| 37 |
| 38 |
| 39 test2r(a) { |
| 40 return 3 !== a; |
| 41 } |
| 42 |
| 43 |
| 44 test3() { |
| 45 return get5() === 5; |
| 46 } |
| 47 |
| 48 |
| 49 test4(a) { |
| 50 if (a === 3) { |
| 51 return 1; |
| 52 } else { |
| 53 return 2; |
| 54 } |
| 55 } |
| 56 |
| 57 |
| 58 test5(a) { |
| 59 if (a !== 3) { |
| 60 return 1; |
| 61 } else { |
| 62 return 2; |
| 63 } |
| 64 } |
| 65 |
| 66 |
| 67 test6() { |
| 68 if (get5() === 5) { |
| 69 return 1; |
| 70 } else { |
| 71 return 2; |
| 72 } |
| 73 } |
| 74 |
| 75 get5() { |
| 76 return 5; |
| 77 } |
OLD | NEW |