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

Unified Diff: tests/utils/utf_test.dart

Issue 11368138: Add some support for the code-point code-unit distinction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Implemented feedback from patch set 3 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 side-by-side diff with in-line comments
Download patch
Index: tests/utils/utf_test.dart
diff --git a/tests/utils/utf_test.dart b/tests/utils/utf_test.dart
index 64417895cefb712ea9c078aa65524297b39380ff..fe117dbb21b21918ffe2276170081d54cefd383f 100644
--- a/tests/utils/utf_test.dart
+++ b/tests/utils/utf_test.dart
@@ -6,9 +6,9 @@ library utf_test;
import 'dart:utf';
main() {
- String str = codepointsToString([0x1d537]);
- // String.charCodes gives 16-bit code units, but stringToCodepoints gives
- // back the original code points.
- Expect.listEquals([0xd835, 0xdd37], str.charCodes);
- Expect.listEquals([0x1d537], stringToCodepoints(str));
+ String str = new String.fromCharCodes([0x1d537]);
+ // String.charCodes gives the original code points and String.codeUnits
+ // gives back 16-bit code units
+ Expect.listEquals([0xd835, 0xdd37], str.codeUnits);
+ Expect.listEquals([0x1d537], str.charCodes);
}
« runtime/vm/unicode.h ('K') | « tests/utils/utf8_test.dart ('k') | tests/utils/utils.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698