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

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

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head Created 7 years, 10 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
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 /** 5 /**
6 * A test of simple runtime behavior on numbers, strings and lists with 6 * A test of simple runtime behavior on numbers, strings and lists with
7 * a focus on both correct behavior and runtime errors. 7 * a focus on both correct behavior and runtime errors.
8 * 8 *
9 * This file is written to use minimal type declarations to match a 9 * This file is written to use minimal type declarations to match a
10 * typical dynamic language coding style. 10 * typical dynamic language coding style.
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } catch (e) { } 146 } catch (e) { }
147 try { 147 try {
148 y.toRadixString(-1); 148 y.toRadixString(-1);
149 Expect.fail("Illegal radix -1 accepted."); 149 Expect.fail("Illegal radix -1 accepted.");
150 } catch (e) { } 150 } catch (e) { }
151 } 151 }
152 152
153 static testStringOperators() { 153 static testStringOperators() {
154 var s = "abcdef"; 154 var s = "abcdef";
155 assertEquals(s, "abcdef"); 155 assertEquals(s, "abcdef");
156 assertEquals(s.charCodeAt(0), 97); 156 assertEquals(s.codeUnitAt(0), 97);
157 assertEquals(s[0], 'a'); 157 assertEquals(s[0], 'a');
158 assertEquals(s.length, 6); 158 assertEquals(s.length, 6);
159 assertTypeError(() { s[null]; }); 159 assertTypeError(() { s[null]; });
160 assertTypeError(() { s['hello']; }); 160 assertTypeError(() { s['hello']; });
161 assertTypeError(() { s[0] = 'x'; }); 161 assertTypeError(() { s[0] = 'x'; });
162 } 162 }
163 163
164 // TODO(jimhug): Fill out full set of string methods. 164 // TODO(jimhug): Fill out full set of string methods.
165 static testStringMethods() { 165 static testStringMethods() {
166 var s = "abcdef"; 166 var s = "abcdef";
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 '${true}'.toString(); 274 '${true}'.toString();
275 '${false}'.toString(); 275 '${false}'.toString();
276 ''.toString(); 276 ''.toString();
277 ''.endsWith(''); 277 ''.endsWith('');
278 } 278 }
279 } 279 }
280 280
281 main() { 281 main() {
282 CoreRuntimeTypesTest.testMain(); 282 CoreRuntimeTypesTest.testMain();
283 } 283 }
OLDNEW
« no previous file with comments | « tests/corelib/collection_to_string_test.dart ('k') | tests/corelib/is_operator_basic_types_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698