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