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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 """; | 44 """; |
45 | 45 |
46 const String TEST_GREATER_EQUAL = r""" | 46 const String TEST_GREATER_EQUAL = r""" |
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'); | |
55 | |
56 asyncTest(() => Future.wait([ | 54 asyncTest(() => Future.wait([ |
57 compile(TEST_EQUAL, entry: 'foo', check: (String generated) { | 55 compile(TEST_EQUAL, entry: 'foo', check: (String generated) { |
58 Expect.isFalse(generated.contains('=== true')); | 56 Expect.isFalse(generated.contains('=== true')); |
59 Expect.isTrue(generated.contains('eqB')); | 57 Expect.isTrue(generated.contains('eqB')); |
60 }), | 58 }), |
61 compile(TEST_EQUAL_NULL, entry: 'foo', check: (String generated) { | 59 compile(TEST_EQUAL_NULL, entry: 'foo', check: (String generated) { |
62 Expect.isFalse(generated.contains('=== true')); | 60 Expect.isFalse(generated.contains('=== true')); |
63 Expect.isTrue(generated.contains('== null')); | 61 Expect.isTrue(generated.contains('== null')); |
64 }), | 62 }), |
65 compile(TEST_LESS, entry: 'foo', check: (String generated) { | 63 compile(TEST_LESS, entry: 'foo', check: (String generated) { |
66 Expect.isFalse(generated.contains('=== true')); | 64 Expect.isFalse(generated.contains('=== true')); |
67 Expect.isTrue(generated.contains('ltB')); | 65 Expect.isTrue(generated.contains('ltB')); |
68 }), | 66 }), |
69 compile(TEST_LESS_EQUAL, entry: 'foo', check: (String generated) { | 67 compile(TEST_LESS_EQUAL, entry: 'foo', check: (String generated) { |
70 Expect.isFalse(generated.contains('=== true')); | 68 Expect.isFalse(generated.contains('=== true')); |
71 Expect.isTrue(generated.contains('leB')); | 69 Expect.isTrue(generated.contains('leB')); |
72 }), | 70 }), |
73 compile(TEST_GREATER, entry: 'foo', check: (String generated) { | 71 compile(TEST_GREATER, entry: 'foo', check: (String generated) { |
74 Expect.isFalse(generated.contains('=== true')); | 72 Expect.isFalse(generated.contains('=== true')); |
75 Expect.isTrue(generated.contains('gtB')); | 73 Expect.isTrue(generated.contains('gtB')); |
76 }), | 74 }), |
77 compile(TEST_GREATER_EQUAL, entry: 'foo', check: (String generated) { | 75 compile(TEST_GREATER_EQUAL, entry: 'foo', check: (String generated) { |
78 Expect.isFalse(generated.contains('=== true')); | 76 Expect.isFalse(generated.contains('=== true')); |
79 Expect.isTrue(generated.contains('geB')); | 77 Expect.isTrue(generated.contains('geB')); |
80 }), | 78 }), |
81 ])); | 79 ])); |
82 } | 80 } |
OLD | NEW |