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

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

Issue 15263004: Adding isNotEmpty property to collection and string. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix template generation Created 7 years, 6 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/collection_length_test.dart ('k') | tests/corelib/list_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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 /** 7 /**
8 * A test of simple runtime behavior on numbers, strings and lists with 8 * A test of simple runtime behavior on numbers, strings and lists with
9 * a focus on both correct behavior and runtime errors. 9 * a focus on both correct behavior and runtime errors.
10 * 10 *
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 assertEquals(s.length, 6); 160 assertEquals(s.length, 6);
161 assertTypeError(() { s[null]; }); 161 assertTypeError(() { s[null]; });
162 assertTypeError(() { s['hello']; }); 162 assertTypeError(() { s['hello']; });
163 assertTypeError(() { s[0] = 'x'; }); 163 assertTypeError(() { s[0] = 'x'; });
164 } 164 }
165 165
166 // TODO(jimhug): Fill out full set of string methods. 166 // TODO(jimhug): Fill out full set of string methods.
167 static testStringMethods() { 167 static testStringMethods() {
168 var s = "abcdef"; 168 var s = "abcdef";
169 assertEquals(s.isEmpty, false); 169 assertEquals(s.isEmpty, false);
170 assertEquals(s.isNotEmpty, true);
170 assertEquals(s.startsWith("abc"), true); 171 assertEquals(s.startsWith("abc"), true);
171 assertEquals(s.endsWith("def"), true); 172 assertEquals(s.endsWith("def"), true);
172 assertEquals(s.startsWith("aa"), false); 173 assertEquals(s.startsWith("aa"), false);
173 assertEquals(s.endsWith("ff"), false); 174 assertEquals(s.endsWith("ff"), false);
174 assertEquals(s.contains('cd', 0), true); 175 assertEquals(s.contains('cd', 0), true);
175 assertEquals(s.contains('cd', 2), true); 176 assertEquals(s.contains('cd', 2), true);
176 assertEquals(s.contains('cd', 3), false); 177 assertEquals(s.contains('cd', 3), false);
177 assertEquals(s.indexOf('cd', 2), 2); 178 assertEquals(s.indexOf('cd', 2), 2);
178 assertEquals(s.indexOf('cd', 3), -1); 179 assertEquals(s.indexOf('cd', 3), -1);
179 180
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 '${true}'.toString(); 277 '${true}'.toString();
277 '${false}'.toString(); 278 '${false}'.toString();
278 ''.toString(); 279 ''.toString();
279 ''.endsWith(''); 280 ''.endsWith('');
280 } 281 }
281 } 282 }
282 283
283 main() { 284 main() {
284 CoreRuntimeTypesTest.testMain(); 285 CoreRuntimeTypesTest.testMain();
285 } 286 }
OLDNEW
« no previous file with comments | « tests/corelib/collection_length_test.dart ('k') | tests/corelib/list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698