| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Test that logical or-expressions don't introduce unnecessary nots. | 5 // Test that logical or-expressions don't introduce unnecessary nots. |
| 6 | 6 |
| 7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
| 8 import 'compiler_helper.dart'; | 8 import 'compiler_helper.dart'; |
| 9 | 9 |
| 10 const String TEST_ONE = r""" | 10 const String TEST_ONE = r""" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // var t1 = list == null; | 38 // var t1 = list == null; |
| 39 // if (t1) bar.call$0(); | 39 // if (t1) bar.call$0(); |
| 40 // if (t1 || bar.call$0() === true) bar.call$0(); | 40 // if (t1 || bar.call$0() === true) bar.call$0(); |
| 41 // if (t1 || bar.call$0() === true) bar.call$0(); | 41 // if (t1 || bar.call$0() === true) bar.call$0(); |
| 42 compileAndMatchFuzzy(TEST_TWO, 'foo', | 42 compileAndMatchFuzzy(TEST_TWO, 'foo', |
| 43 r"""var x = x == null; | 43 r"""var x = x == null; |
| 44 if \(x\) [^;]+; | 44 if \(x\) [^;]+; |
| 45 if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+; | 45 if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+; |
| 46 if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;"""); | 46 if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;"""); |
| 47 } | 47 } |
| OLD | NEW |