| ... | ... | @@ -164,7 +164,6 @@ pub fn utf8ValidCodepoint(value: u21) bool { |
| 164 | 164 | |
| 165 | 165 | /// Returns the length of a supplied UTF-8 string literal in terms of unicode |
| 166 | 166 | /// codepoints. |
| 167 | | /// Asserts that the data is valid UTF-8. |
| 168 | 167 | pub fn utf8CountCodepoints(s: []const u8) !usize { |
| 169 | 168 | var len: usize = 0; |
| 170 | 169 | |
| ... | ... | @@ -351,7 +350,6 @@ fn testUtf16CountCodepoints() !void { |
| 351 | 350 | @as(usize, 5), |
| 352 | 351 | try utf16CountCodepoints(utf8ToUtf16LeStringLiteral("こんにちは")), |
| 353 | 352 | ); |
| 354 | | // testing.expectError(error.Utf8EncodesSurrogateHalf, utf8CountCodepoints("\xED\xA0\x80")); |
| 355 | 353 | } |
| 356 | 354 | |
| 357 | 355 | test "utf16 count codepoints" { |
| ... | ... | @@ -820,7 +818,6 @@ fn testCalcUtf16LeLen() !void { |
| 820 | 818 | try testing.expectEqual(@as(usize, 10), try calcUtf16LeLen("abcdefghij")); |
| 821 | 819 | try testing.expectEqual(@as(usize, 10), try calcUtf16LeLen("äåéëþüúíóö")); |
| 822 | 820 | try testing.expectEqual(@as(usize, 5), try calcUtf16LeLen("こんにちは")); |
| 823 | | // testing.expectError(error.Utf8EncodesSurrogateHalf, utf8CountCodepoints("\xED\xA0\x80")); |
| 824 | 821 | } |
| 825 | 822 | |
| 826 | 823 | test "calculate utf16 string length of given utf8 string in u16" { |