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

Unified Diff: packages/utf/test/unicode_core_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/utf/test/expect.dart ('k') | packages/utf/test/utf16_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/utf/test/unicode_core_test.dart
diff --git a/packages/utf/test/unicode_core_test.dart b/packages/utf/test/unicode_core_test.dart
index 6e13e965eb4508e70649ecdd90c2664e78d1fb3d..24cc7103ddff60f1ea5d6e732cc0b1b6d3902846 100755
--- a/packages/utf/test/unicode_core_test.dart
+++ b/packages/utf/test/unicode_core_test.dart
@@ -4,32 +4,30 @@
library utf.unicode_core_test;
-import 'package:expect/expect.dart';
-
+import 'package:test/test.dart';
import 'package:utf/utf.dart';
import 'package:utf/src/util.dart';
+import 'expect.dart' as Expect;
+
void main() {
- testCodepointsToUtf16CodeUnits();
- testUtf16bytesToCodepoints();
+ test('codepoints to utf16 codepoints', testCodepointsToUtf16CodeUnits);
+ test('utf16 bytes to codepoints', testUtf16bytesToCodepoints);
}
void testCodepointsToUtf16CodeUnits() {
// boundary conditions
Expect.listEquals([], codepointsToUtf16CodeUnits([]), "no input");
Expect.listEquals([0x0], codepointsToUtf16CodeUnits([0x0]), "0");
- Expect.listEquals([0xd800, 0xdc00],
- codepointsToUtf16CodeUnits([0x10000]), "10000");
+ Expect.listEquals(
+ [0xd800, 0xdc00], codepointsToUtf16CodeUnits([0x10000]), "10000");
- Expect.listEquals([0xffff],
- codepointsToUtf16CodeUnits([0xffff]), "ffff");
- Expect.listEquals([0xdbff, 0xdfff],
- codepointsToUtf16CodeUnits([0x10ffff]), "10ffff");
+ Expect.listEquals([0xffff], codepointsToUtf16CodeUnits([0xffff]), "ffff");
+ Expect.listEquals(
+ [0xdbff, 0xdfff], codepointsToUtf16CodeUnits([0x10ffff]), "10ffff");
- Expect.listEquals([0xd7ff],
- codepointsToUtf16CodeUnits([0xd7ff]), "d7ff");
- Expect.listEquals([0xe000],
- codepointsToUtf16CodeUnits([0xe000]), "e000");
+ Expect.listEquals([0xd7ff], codepointsToUtf16CodeUnits([0xd7ff]), "d7ff");
+ Expect.listEquals([0xe000], codepointsToUtf16CodeUnits([0xe000]), "e000");
Expect.listEquals([UNICODE_REPLACEMENT_CHARACTER_CODEPOINT],
codepointsToUtf16CodeUnits([0xd800]), "d800");
@@ -41,52 +39,49 @@ void testUtf16bytesToCodepoints() {
// boundary conditions: First possible values
Expect.listEquals([], utf16CodeUnitsToCodepoints([]), "no input");
Expect.listEquals([0x0], utf16CodeUnitsToCodepoints([0x0]), "0");
- Expect.listEquals([0x10000],
- utf16CodeUnitsToCodepoints([0xd800, 0xdc00]), "10000");
+ Expect.listEquals(
+ [0x10000], utf16CodeUnitsToCodepoints([0xd800, 0xdc00]), "10000");
// boundary conditions: Last possible sequence of a certain length
- Expect.listEquals([0xffff],
- utf16CodeUnitsToCodepoints([0xffff]), "ffff");
- Expect.listEquals([0x10ffff],
- utf16CodeUnitsToCodepoints([0xdbff, 0xdfff]), "10ffff");
+ Expect.listEquals([0xffff], utf16CodeUnitsToCodepoints([0xffff]), "ffff");
+ Expect.listEquals(
+ [0x10ffff], utf16CodeUnitsToCodepoints([0xdbff, 0xdfff]), "10ffff");
// other boundary conditions
- Expect.listEquals([0xd7ff],
- utf16CodeUnitsToCodepoints([0xd7ff]), "d7ff");
- Expect.listEquals([0xe000],
- utf16CodeUnitsToCodepoints([0xe000]), "e000");
+ Expect.listEquals([0xd7ff], utf16CodeUnitsToCodepoints([0xd7ff]), "d7ff");
+ Expect.listEquals([0xe000], utf16CodeUnitsToCodepoints([0xe000]), "e000");
// unexpected continuation bytes
- Expect.listEquals([0xfffd],
- utf16CodeUnitsToCodepoints([0xdc00]),
+ Expect.listEquals([0xfffd], utf16CodeUnitsToCodepoints([0xdc00]),
"dc00 first unexpected continuation byte");
- Expect.listEquals([0xfffd],
- utf16CodeUnitsToCodepoints([0xdfff]),
+ Expect.listEquals([0xfffd], utf16CodeUnitsToCodepoints([0xdfff]),
"dfff last unexpected continuation byte");
- Expect.listEquals([0xfffd],
- utf16CodeUnitsToCodepoints([0xdc00]),
+ Expect.listEquals([0xfffd], utf16CodeUnitsToCodepoints([0xdc00]),
"1 unexpected continuation bytes");
- Expect.listEquals([0xfffd, 0xfffd],
+ Expect.listEquals(
+ [0xfffd, 0xfffd],
utf16CodeUnitsToCodepoints([0xdc00, 0xdc00]),
"2 unexpected continuation bytes");
- Expect.listEquals([0xfffd, 0xfffd ,0xfffd],
+ Expect.listEquals(
+ [0xfffd, 0xfffd, 0xfffd],
utf16CodeUnitsToCodepoints([0xdc00, 0xdc00, 0xdc00]),
"3 unexpected continuation bytes");
// incomplete sequences
- Expect.listEquals([0xfffd], utf16CodeUnitsToCodepoints([0xd800]),
- "d800 last byte missing");
- Expect.listEquals([0xfffd], utf16CodeUnitsToCodepoints([0xdbff]),
- "dbff last byte missing");
+ Expect.listEquals(
+ [0xfffd], utf16CodeUnitsToCodepoints([0xd800]), "d800 last byte missing");
+ Expect.listEquals(
+ [0xfffd], utf16CodeUnitsToCodepoints([0xdbff]), "dbff last byte missing");
// concatenation of incomplete sequences
- Expect.listEquals([0xfffd, 0xfffd],
+ Expect.listEquals(
+ [0xfffd, 0xfffd],
utf16CodeUnitsToCodepoints([0xd800, 0xdbff]),
"d800 dbff last byte missing");
// impossible bytes
- Expect.listEquals([0xfffd], utf16CodeUnitsToCodepoints([0x110000]),
- "110000 out of bounds");
+ Expect.listEquals(
+ [0xfffd], utf16CodeUnitsToCodepoints([0x110000]), "110000 out of bounds");
// overlong sequences not possible in utf16 (nothing < x10000)
// illegal code positions d800-dfff not encodable (< x10000)
« no previous file with comments | « packages/utf/test/expect.dart ('k') | packages/utf/test/utf16_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698