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

Side by Side Diff: tests/corelib/reg_exp_all_matches_test.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « tests/corelib/list_test.dart ('k') | tests/corelib/string_buffer_test.dart » ('j') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Dart test program for RegExp.allMatches. 5 // Dart test program for RegExp.allMatches.
6 6
7 class RegExpAllMatchesTest { 7 class RegExpAllMatchesTest {
8 static testIterator() { 8 static testIterator() {
9 var matches = new RegExp("foo").allMatches("foo foo"); 9 var matches = new RegExp("foo").allMatches("foo foo");
10 Iterator it = matches.iterator(); 10 Iterator it = matches.iterator();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 Expect.equals(true, matches.some((Match m) { 80 Expect.equals(true, matches.some((Match m) {
81 return m.group(0).startsWith("foo"); 81 return m.group(0).startsWith("foo");
82 })); 82 }));
83 Expect.equals(false, matches.some((Match m) { 83 Expect.equals(false, matches.some((Match m) {
84 return m.group(0).startsWith("fooo"); 84 return m.group(0).startsWith("fooo");
85 })); 85 }));
86 } 86 }
87 87
88 static testIsEmpty() { 88 static testIsEmpty() {
89 var matches = new RegExp("foo?").allMatches("foo fo foo fo"); 89 var matches = new RegExp("foo?").allMatches("foo fo foo fo");
90 Expect.equals(false, matches.isEmpty()); 90 Expect.equals(false, matches.isEmpty);
91 matches = new RegExp("fooo").allMatches("foo fo foo fo"); 91 matches = new RegExp("fooo").allMatches("foo fo foo fo");
92 Expect.equals(true, matches.isEmpty()); 92 Expect.equals(true, matches.isEmpty);
93 } 93 }
94 94
95 static testGetCount() { 95 static testGetCount() {
96 var matches = new RegExp("foo?").allMatches("foo fo foo fo"); 96 var matches = new RegExp("foo?").allMatches("foo fo foo fo");
97 Expect.equals(4, matches.length); 97 Expect.equals(4, matches.length);
98 matches = new RegExp("fooo").allMatches("foo fo foo fo"); 98 matches = new RegExp("fooo").allMatches("foo fo foo fo");
99 Expect.equals(0, matches.length); 99 Expect.equals(0, matches.length);
100 } 100 }
101 101
102 static testMain() { 102 static testMain() {
103 testIterator(); 103 testIterator();
104 testForEach(); 104 testForEach();
105 testMap(); 105 testMap();
106 testFilter(); 106 testFilter();
107 testEvery(); 107 testEvery();
108 testSome(); 108 testSome();
109 testIsEmpty(); 109 testIsEmpty();
110 testGetCount(); 110 testGetCount();
111 } 111 }
112 } 112 }
113 113
114 main() { 114 main() {
115 RegExpAllMatchesTest.testMain(); 115 RegExpAllMatchesTest.testMain();
116 } 116 }
OLDNEW
« no previous file with comments | « tests/corelib/list_test.dart ('k') | tests/corelib/string_buffer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698