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

Side by Side Diff: tests/corelib_strong/regexp/default_arguments_test.dart

Issue 2989863002: Migrated test block 19 to Dart 2.0. (Closed)
Patch Set: Created 3 years, 4 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 | « tests/corelib_strong/regexp/constructor_test.dart ('k') | tests/corelib_strong/regexp/dotstar_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698