OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 | 4 |
5 library boolified_operator_test; | 5 library boolified_operator_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'compiler_helper.dart'; | 10 import 'compiler_helper.dart'; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 foo(param0, param1) { | 47 foo(param0, param1) { |
48 if (param0 >= param1) return 0; | 48 if (param0 >= param1) return 0; |
49 return 1; | 49 return 1; |
50 } | 50 } |
51 """; | 51 """; |
52 | 52 |
53 main() { | 53 main() { |
54 RegExp regexp = new RegExp('=== true'); | 54 RegExp regexp = new RegExp('=== true'); |
55 | 55 |
56 asyncTest(() => Future.wait([ | 56 asyncTest(() => Future.wait([ |
57 compile(TEST_EQUAL, entry: 'foo', check: (String generated) { | 57 compile(TEST_EQUAL, entry: 'foo', check: (String generated) { |
58 Expect.isFalse(generated.contains('=== true')); | 58 Expect.isFalse(generated.contains('=== true')); |
59 Expect.isTrue(generated.contains('eqB')); | 59 Expect.isTrue(generated.contains('eqB')); |
60 }), | 60 }), |
61 compile(TEST_EQUAL_NULL, entry: 'foo', check: (String generated) { | 61 compile(TEST_EQUAL_NULL, entry: 'foo', check: (String generated) { |
62 Expect.isFalse(generated.contains('=== true')); | 62 Expect.isFalse(generated.contains('=== true')); |
63 Expect.isTrue(generated.contains('== null')); | 63 Expect.isTrue(generated.contains('== null')); |
64 }), | 64 }), |
65 compile(TEST_LESS, entry: 'foo', check: (String generated) { | 65 compile(TEST_LESS, entry: 'foo', check: (String generated) { |
66 Expect.isFalse(generated.contains('=== true')); | 66 Expect.isFalse(generated.contains('=== true')); |
67 Expect.isTrue(generated.contains('ltB')); | 67 Expect.isTrue(generated.contains('ltB')); |
68 }), | 68 }), |
69 compile(TEST_LESS_EQUAL, entry: 'foo', check: (String generated) { | 69 compile(TEST_LESS_EQUAL, entry: 'foo', check: (String generated) { |
70 Expect.isFalse(generated.contains('=== true')); | 70 Expect.isFalse(generated.contains('=== true')); |
71 Expect.isTrue(generated.contains('leB')); | 71 Expect.isTrue(generated.contains('leB')); |
72 }), | 72 }), |
73 compile(TEST_GREATER, entry: 'foo', check: (String generated) { | 73 compile(TEST_GREATER, entry: 'foo', check: (String generated) { |
74 Expect.isFalse(generated.contains('=== true')); | 74 Expect.isFalse(generated.contains('=== true')); |
75 Expect.isTrue(generated.contains('gtB')); | 75 Expect.isTrue(generated.contains('gtB')); |
76 }), | 76 }), |
77 compile(TEST_GREATER_EQUAL, entry: 'foo', check: (String generated) { | 77 compile(TEST_GREATER_EQUAL, entry: 'foo', check: (String generated) { |
78 Expect.isFalse(generated.contains('=== true')); | 78 Expect.isFalse(generated.contains('=== true')); |
79 Expect.isTrue(generated.contains('geB')); | 79 Expect.isTrue(generated.contains('geB')); |
80 }), | 80 }), |
81 ])); | 81 ])); |
82 } | 82 } |
OLD | NEW |