From 4cc14129e81f8804e73321f0ccf5484397a5ddce Mon Sep 17 00:00:00 2001 From: Aske Simon Christensen Date: Mon, 4 May 2020 17:52:20 +0200 Subject: [PATCH] Delete surrogate-related subtests to be compatible match breaking change to UTF-8 encoding and decoding (#42) * Delete surrogate-related subtests to be compatible with both behaviors --- test/utf8_test.dart | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/test/utf8_test.dart b/test/utf8_test.dart index 8e9937f..ab673b2 100644 --- a/test/utf8_test.dart +++ b/test/utf8_test.dart @@ -51,22 +51,6 @@ main() { expect(end, "πŸ˜ŽπŸ‘ΏπŸ’¬"); }); - test("toUtf8 unpaired surrogate", () { - final String start = String.fromCharCodes([0xD800, 0x1000]); - final Pointer converted = Utf8.toUtf8(start).cast(); - final int length = Utf8.strlen(converted); - final Uint8List end = converted.cast().asTypedList(length + 1); - expect(end, equals([237, 160, 128, 225, 128, 128, 0])); - free(converted); - }); - - test("fromUtf8 unpaired surrogate", () { - final Pointer utf8 = - _bytesFromList([237, 160, 128, 225, 128, 128, 0]).cast(); - final String end = Utf8.fromUtf8(utf8); - expect(end, equals(String.fromCharCodes([0xD800, 0x1000]))); - }); - test("fromUtf8 invalid", () { final Pointer utf8 = _bytesFromList([0x80, 0x00]).cast(); expect(() => Utf8.fromUtf8(utf8), throwsA(isFormatException));