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

Side by Side Diff: test/codegen/corelib/regexp/default_arguments_test.dart

Issue 1945153002: Add corelib tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: error_test and range_error_test now pass Created 4 years, 7 months 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
OLDNEW
(Empty)
1 // Copyright (c) 2015, 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 // Test that `null` is interpreted as `false` when passed as argument to
6 // `caseSensitive` and `multiLine`.
7
8 import 'package:expect/expect.dart';
9
10 main() {
11 testCaseSensitive();
12 testMultiLine();
13 }
14
15 testCaseSensitive() {
16 var r1 = new RegExp('foo');
17 var r2 = new RegExp('foo', caseSensitive: true);
18 var r3 = new RegExp('foo', caseSensitive: false);
19 var r4 = new RegExp('foo', caseSensitive: null);
20 Expect.isNull(r1.firstMatch('Foo'), "r1.firstMatch('Foo')");
21 Expect.isNull(r2.firstMatch('Foo'), "r2.firstMatch('Foo')");
22 Expect.isNotNull(r3.firstMatch('Foo'), "r3.firstMatch('Foo')");
23 Expect.isNotNull(r4.firstMatch('Foo'), "r4.firstMatch('Foo')");
24 }
25
26 testMultiLine() {
27 var r1 = new RegExp(r'^foo$');
28 var r2 = new RegExp(r'^foo$', multiLine: true);
29 var r3 = new RegExp(r'^foo$', multiLine: false);
30 var r4 = new RegExp(r'^foo$', multiLine: null);
31 Expect.isNull(r1.firstMatch('\nfoo\n'), "r1.firstMatch('\\nfoo\\n')");
32 Expect.isNotNull(r2.firstMatch('\nfoo\n'), "r2.firstMatch('\\nfoo\\n')");
33 Expect.isNull(r3.firstMatch('\nfoo\n'), "r3.firstMatch('\\nfoo\\n')");
34 Expect.isNull(r4.firstMatch('\nfoo\n'), "r4.firstMatch('\\nfoo\\n')");
35 }
OLDNEW
« no previous file with comments | « test/codegen/corelib/regexp/constructor_test.dart ('k') | test/codegen/corelib/regexp/dotstar_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698