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

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

Issue 11411092: Revert "Add some support for the code-point code-unit distinction." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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_trim_unicode_test.dart ('k') | tests/language/language_dart2js.status » ('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) 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
3 // BSD-style license that can be found in the LICENSE file.
4
5 class SurrogatePairTest {
6
7 static testMain() {
8 var monkeyFace = "🐵";
9 var aceOfSpades = "🂡";
10 var gronthismata = "𝁅";
11 var segno = "𝄋";
12
13 Expect.equals(monkeyFace, monkeyFace.toUpperCase());
14 Expect.equals(monkeyFace, monkeyFace.toLowerCase());
15 Expect.equals(aceOfSpades, aceOfSpades.toUpperCase());
16 Expect.equals(aceOfSpades, aceOfSpades.toLowerCase());
17 Expect.equals(gronthismata, gronthismata.toUpperCase());
18 Expect.equals(gronthismata, gronthismata.toLowerCase());
19 Expect.equals(segno, segno.toUpperCase());
20 Expect.equals(segno, segno.toLowerCase());
21
22 var mixedMitt = new String.fromCharCodes([0x10423, 0x1042e, 0x1043b]);
23 var upperMitt = new String.fromCharCodes([0x10423, 0x10406, 0x10413]);
24 var lowerMitt = new String.fromCharCodes([0x1044b, 0x1042e, 0x1043b]);
25 Expect.equals(upperMitt, mixedMitt.toUpperCase());
26 Expect.equals(lowerMitt, mixedMitt.toLowerCase());
27 Expect.equals(upperMitt, upperMitt.toUpperCase());
28 Expect.equals(lowerMitt, upperMitt.toLowerCase());
29 Expect.equals(upperMitt, lowerMitt.toUpperCase());
30 Expect.equals(lowerMitt, lowerMitt.toLowerCase());
31
32 var mixedXMitt = new String.fromCharCodes([0x78, 0x10423, 0x1042e, 0x1043b]) ;
33 var upperXMitt = new String.fromCharCodes([0X58, 0x10423, 0x10406, 0x10413]) ;
34 var lowerXMitt = new String.fromCharCodes([0x78, 0x1044b, 0x1042e, 0x1043b]) ;
35 Expect.equals(upperXMitt, mixedXMitt.toUpperCase());
36 Expect.equals(lowerXMitt, mixedXMitt.toLowerCase());
37 Expect.equals(upperXMitt, upperXMitt.toUpperCase());
38 Expect.equals(lowerXMitt, upperXMitt.toLowerCase());
39 Expect.equals(upperXMitt, lowerXMitt.toUpperCase());
40 Expect.equals(lowerXMitt, lowerXMitt.toLowerCase());
41
42 var mixedDotMitt = new String.fromCharCodes([0x2e, 0x10423, 0x1042e, 0x1043b ]);
43 var upperDotMitt = new String.fromCharCodes([0X2e, 0x10423, 0x10406, 0x10413 ]);
44 var lowerDotMitt = new String.fromCharCodes([0x2e, 0x1044b, 0x1042e, 0x1043b ]);
45 Expect.equals(upperDotMitt, mixedDotMitt.toUpperCase());
46 Expect.equals(lowerDotMitt, mixedDotMitt.toLowerCase());
47 Expect.equals(upperDotMitt, upperDotMitt.toUpperCase());
48 Expect.equals(lowerDotMitt, upperDotMitt.toLowerCase());
49 Expect.equals(upperDotMitt, lowerDotMitt.toUpperCase());
50 Expect.equals(lowerDotMitt, lowerDotMitt.toLowerCase());
51
52 var lowerOw = new String.fromCharCodes([0x10435]);
53 var upperOw = new String.fromCharCodes([0x1040d]);
54 Expect.equals(lowerOw.codeUnitAt(1), monkeyFace.codeUnitAt(1));
55 Expect.equals(upperOw, lowerOw.toUpperCase());
56 Expect.equals(upperOw, upperOw.toUpperCase());
57 Expect.equals(lowerOw, lowerOw.toLowerCase());
58 Expect.equals(lowerOw, upperOw.toLowerCase());
59 }
60 }
61
62 main() {
63 SurrogatePairTest.testMain();
64 }
OLDNEW
« no previous file with comments | « tests/corelib/string_trim_unicode_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698