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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « tests/corelib/string_base_vm_test.dart ('k') | tests/corelib/string_from_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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 main() {
6 Expect.equals("A", new String.character(65));
7 Expect.equals("B", new String.character(66));
8 var gClef = new String.character(0x1D11E);
9 Expect.equals(2, gClef.length);
10 Expect.equals(0xD834, gClef.charCodeAt(0));
11 Expect.equals(0xDD1E, gClef.charCodeAt(1));
12
13 // Unmatched surrogates.
14 var unmatched = new String.character(0xD800);
15 Expect.equals(1, unmatched.length);
16 Expect.equals(0xD800, unmatched.charCodeAt(0));
17 unmatched = new String.character(0xDC00);
18 Expect.equals(1, unmatched.length);
19 Expect.equals(0xDC00, unmatched.charCodeAt(0));
20
21 Expect.throws(() => new String.character(-1),
22 (e) => e is ArgumentError);
23
24 // Invalid code point.
25 Expect.throws(() => new String.character(0x110000),
26 (e) => e is ArgumentError);
27
28 Expect.throws(() => new String.character(0x110001),
29 (e) => e is ArgumentError);
30 }
OLDNEW
« no previous file with comments | « tests/corelib/string_base_vm_test.dart ('k') | tests/corelib/string_from_list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698