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 void or1() { | |
6 var b = true; | |
7 b = b || b; | |
8 Expect.equals(true, b); | |
9 } | |
10 | |
11 void or2() { | |
12 var b = false; | |
13 b = b || b; | |
14 Expect.equals(false, b); | |
15 } | |
16 | |
17 void or3() { | |
18 var b = true; | |
19 b = b || false; | |
20 Expect.equals(true, b); | |
21 } | |
22 | |
23 void or4() { | |
24 var b = true; | |
25 b = b || true; | |
26 Expect.equals(true, b); | |
27 } | |
28 | |
29 void or5() { | |
30 if (true || false) { | |
31 } else { | |
32 Expect.fail('unreachable'); | |
33 } | |
34 } | |
35 | |
36 void or6() { | |
37 var b = true; | |
38 if (true || true) b = false; | |
39 Expect.equals(false, b); | |
40 } | |
41 | |
42 void or7() { | |
43 var b = false; | |
44 if (true || false) { | |
45 b = true; | |
46 } else { | |
47 b = false; | |
48 } | |
49 Expect.equals(true, b); | |
50 } | |
51 | |
52 void main() { | |
53 or1(); | |
54 or2(); | |
55 or3(); | |
56 or4(); | |
57 or5(); | |
58 or6(); | |
59 or7(); | |
60 } | |
OLD | NEW |