Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1063)

Side by Side Diff: tests/compiler/dart2js/kernel/assert_test.dart

Issue 2479323003: Adding check or trust type checks to builder_kernel.dart. (Closed)
Patch Set: .. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/type_builder.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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, extraOptions: const <String>[Flags.enableCheckedMode]);
18 }); 18 });
19 19
20 test('assert with message', () { 20 test('assert with message', () {
21 String code = ''' 21 String code = '''
22 bool foo() => 2 + 2 == 4; 22 bool foo() => 2 + 2 == 4;
23 main() { 23 main() {
24 assert(foo(), "foo failed"); 24 assert(foo(), "foo failed");
25 }'''; 25 }''';
26 return check(code, 26 return check(code,
27 // disable type inference because kernel doesn't yet support
28 // checked mode type checks
29 disableTypeInference: false,
30 extraOptions: const <String>[ 27 extraOptions: const <String>[
31 Flags.enableCheckedMode, 28 Flags.enableCheckedMode,
32 Flags.enableAssertMessage, 29 Flags.enableAssertMessage,
33 ]); 30 ]);
34 }); 31 });
35 } 32 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/type_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698