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

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

Issue 860273002: Recognize and special case String.fromCharCodes for Uint8List in JavaScript. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | « sdk/lib/_internal/compiler/js_lib/js_helper.dart ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import "dart:typed_data"; 6 import "dart:typed_data";
7 7
8 main() { 8 main() {
9 iter(count, [values]) => values is List 9 iter(count, [values]) => values is List
10 ? new Iterable.generate(count, (x) => values[x]) 10 ? new Iterable.generate(count, (x) => values[x])
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 } 187 }
188 188
189 testSubstring(""); 189 testSubstring("");
190 testSubstring("ABCDEFGH"); 190 testSubstring("ABCDEFGH");
191 // length > 128 191 // length > 128
192 testSubstring("ABCDEFGH" * 33); 192 testSubstring("ABCDEFGH" * 33);
193 testSubstring("\x00" * 357); 193 testSubstring("\x00" * 357);
194 // length > 128 and non-ASCII. 194 // length > 128 and non-ASCII.
195 testSubstring("\uFFFD\uFFFE\u{10000}\u{10ffff}c\x00" * 37); 195 testSubstring("\uFFFD\uFFFE\u{10000}\u{10ffff}c\x00" * 37);
196
197 // Large List.
198 var megaList = ("abcde" * 200000).codeUnits.toList();
199 test("abcde" * 199998, megaList, 5, 999995);
200 // Large Uint8List.
201 test("abcde" * 199998, new Uint8List.fromList(megaList), 5, 999995);
196 } 202 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/js_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698