| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:compiler/src/commandline_options.dart' show Flags; | 5 import 'package:compiler/src/commandline_options.dart' show Flags; |
| 6 import 'package:test/test.dart'; | 6 import 'package:test/test.dart'; |
| 7 | 7 |
| 8 import 'helper.dart' show check; | 8 import 'helper.dart' show check; |
| 9 | 9 |
| 10 main() { | 10 main() { |
| 11 test('assert without message', () { | 11 test('assert without message', () { |
| 12 String code = ''' | 12 String code = ''' |
| 13 bool foo() => 2 + 2 == 4; | 13 bool foo() => 2 + 2 == 4; |
| 14 main() { | 14 main() { |
| 15 assert(foo()); | 15 assert(foo()); |
| 16 }'''; | 16 }'''; |
| 17 return check(code, extraOptions: const <String>[Flags.enableCheckedMode]); | 17 return check(code, |
| 18 extraOptions: const <String>[Flags.enableCheckedMode], |
| 19 useKernelInSsa: true); |
| 18 }); | 20 }); |
| 19 | 21 |
| 20 test('assert with message', () { | 22 test('assert with message', () { |
| 21 String code = ''' | 23 String code = ''' |
| 22 bool foo() => 2 + 2 == 4; | 24 bool foo() => 2 + 2 == 4; |
| 23 main() { | 25 main() { |
| 24 assert(foo(), "foo failed"); | 26 assert(foo(), "foo failed"); |
| 25 }'''; | 27 }'''; |
| 26 return check(code, extraOptions: const <String>[ | 28 return check(code, |
| 27 Flags.enableCheckedMode, | 29 extraOptions: const <String>[ |
| 28 Flags.enableAssertMessage, | 30 Flags.enableCheckedMode, |
| 29 ]); | 31 Flags.enableAssertMessage, |
| 32 ], |
| 33 useKernelInSsa: true); |
| 30 }); | 34 }); |
| 31 } | 35 } |
| OLD | NEW |