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

Unified Diff: tests/lib/convert/utf85_test.dart

Issue 25539006: Reapply utf85_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/convert/utf85_test.dart
diff --git a/tests/lib/convert/utf8_test.dart b/tests/lib/convert/utf85_test.dart
similarity index 53%
copy from tests/lib/convert/utf8_test.dart
copy to tests/lib/convert/utf85_test.dart
index ba5bc898cbd2c8331ae5dacba317191044a1c55a..3b5edc0528cff71e853bf0a1cb7f047103045982 100644
--- a/tests/lib/convert/utf8_test.dart
+++ b/tests/lib/convert/utf85_test.dart
@@ -2,16 +2,14 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+library utf8_test;
import "package:expect/expect.dart";
import 'dart:convert';
-import 'unicode_tests.dart';
-
-String decode(List<int> bytes) => new Utf8Decoder().convert(bytes);
main() {
- for (var test in UNICODE_TESTS) {
- List<int> bytes = test[0];
- String expected = test[1];
- Expect.stringEquals(expected, decode(bytes));
- }
+ for (int i = 0; i <= 0x10FFFF; i++) {
+ if (i == UNICODE_BOM_CHARACTER_RUNE) continue;
+ Expect.equals(i,
+ UTF8.decode(UTF8.encode(new String.fromCharCode(i))).runes.first);
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698