| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 #import("compiler_helper.dart"); |
| 6 |
| 7 final String TEST_EQUAL = @""" |
| 8 foo(param0, param1) { |
| 9 if (param0 == param1) return 0; |
| 10 return 1; |
| 11 } |
| 12 """; |
| 13 |
| 14 final String TEST_EQUAL_NULL = @""" |
| 15 foo(param0) { |
| 16 if (param0 == null) return 0; |
| 17 return 1; |
| 18 } |
| 19 """; |
| 20 |
| 21 final String TEST_LESS = @""" |
| 22 foo(param0, param1) { |
| 23 if (param0 < param1) return 0; |
| 24 return 1; |
| 25 } |
| 26 """; |
| 27 |
| 28 final String TEST_LESS_EQUAL = @""" |
| 29 foo(param0, param1) { |
| 30 if (param0 <= param1) return 0; |
| 31 return 1; |
| 32 } |
| 33 """; |
| 34 final String TEST_GREATER = @""" |
| 35 foo(param0, param1) { |
| 36 if (param0 > param1) return 0; |
| 37 return 1; |
| 38 } |
| 39 """; |
| 40 |
| 41 final String TEST_GREATER_EQUAL = @""" |
| 42 foo(param0, param1) { |
| 43 if (param0 >= param1) return 0; |
| 44 return 1; |
| 45 } |
| 46 """; |
| 47 |
| 48 main() { |
| 49 RegExp regexp = const RegExp('=== true'); |
| 50 |
| 51 String generated = compile(TEST_EQUAL, 'foo'); |
| 52 Expect.isFalse(generated.contains('=== true')); |
| 53 Expect.isTrue(generated.contains('eqB')); |
| 54 |
| 55 generated = compile(TEST_EQUAL_NULL, 'foo'); |
| 56 Expect.isFalse(generated.contains('=== true')); |
| 57 Expect.isTrue(generated.contains('eqNullB')); |
| 58 |
| 59 generated = compile(TEST_LESS, 'foo'); |
| 60 Expect.isFalse(generated.contains('=== true')); |
| 61 Expect.isTrue(generated.contains('ltB')); |
| 62 |
| 63 generated = compile(TEST_LESS_EQUAL, 'foo'); |
| 64 Expect.isFalse(generated.contains('=== true')); |
| 65 Expect.isTrue(generated.contains('leB')); |
| 66 |
| 67 generated = compile(TEST_GREATER, 'foo'); |
| 68 Expect.isFalse(generated.contains('=== true')); |
| 69 Expect.isTrue(generated.contains('gtB')); |
| 70 |
| 71 generated = compile(TEST_GREATER_EQUAL, 'foo'); |
| 72 Expect.isFalse(generated.contains('=== true')); |
| 73 Expect.isTrue(generated.contains('geB')); |
| 74 } |
| OLD | NEW |