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

Unified Diff: tests/utils/utf8_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/utf8_test.dart
diff --git a/tests/utils/utf8_test.dart b/tests/utils/utf8_test.dart
index 541f101b3778b02b1a0ee1db8ed80670572d48da..b92d5aaab0eec67d4e44ba29f34b66c20f0b274f 100644
--- a/tests/utils/utf8_test.dart
+++ b/tests/utils/utf8_test.dart
@@ -7,8 +7,6 @@ import 'dart:utf';
String decode(List<int> bytes) => decodeUtf8(bytes);
-bool isRunningOnJavaScript() => identical(1, 1.0);
-
main() {
// Google favorite: "Îñţérñåţîöñåļîžåţîờñ".
String string = decode([0xc3, 0x8e, 0xc3, 0xb1, 0xc5, 0xa3, 0xc3, 0xa9, 0x72,
@@ -37,14 +35,12 @@ main() {
0xb2, 0xe0, 0xa5, 0x88]);
Expect.stringEquals("िसवा अणामालै", string);
- if (!isRunningOnJavaScript()) {
- // DESERET CAPITAL LETTER BEE, unicode 0x10412(0xD801+0xDC12)
- // UTF-8: F0 90 90 92
- string = decode([0xf0, 0x90, 0x90, 0x92]);
- Expect.stringEquals("𐐒", string);
- } else {
- print('Skipping non-BMP character test');
- }
+ // DESERET CAPITAL LETTER BEE, unicode 0x10412(0xD801+0xDC12)
+ // UTF-8: F0 90 90 92
+ string = decode([0xf0, 0x90, 0x90, 0x92]);
+ Expect.equals(string.length, 2);
+ Expect.equals("𐐒".length, 2);
+ Expect.stringEquals("𐐒", string);
// TODO(ahe): Add tests of bad input.
}

Powered by Google App Engine
This is Rietveld 408576698