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

Unified Diff: tests/utils/utf8_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/io/string_stream_test.dart ('k') | tests/utils/utf_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/utils/utf8_test.dart
diff --git a/tests/utils/utf8_test.dart b/tests/utils/utf8_test.dart
index b92d5aaab0eec67d4e44ba29f34b66c20f0b274f..541f101b3778b02b1a0ee1db8ed80670572d48da 100644
--- a/tests/utils/utf8_test.dart
+++ b/tests/utils/utf8_test.dart
@@ -7,6 +7,8 @@ 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,
@@ -35,12 +37,14 @@ main() {
0xb2, 0xe0, 0xa5, 0x88]);
Expect.stringEquals("िसवा अणामालै", string);
- // 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);
+ 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');
+ }
// TODO(ahe): Add tests of bad input.
}
« no previous file with comments | « tests/standalone/io/string_stream_test.dart ('k') | tests/utils/utf_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698