authorgravatar for jan.hafer@rwth-aachen.deJan Philipp Hafer <jan.hafer@rwth-aachen.de> 2022-05-17 18:56:06+02:00
committergravatar for jan.hafer@rwth-aachen.deJan Philipp Hafer <jan.hafer@rwth-aachen.de> 2022-05-17 18:56:06+02:00
logcf744cf04f8cad148ae93e5c5c7d8c5f5f62c164
treecca31d9f1eed465bc6845b837f852223640fdaad
parent405f4286f729f395ab1f9eb228fdf9cad9434b7c
signaturelock-open Commit is signed but in an unrecognized format.

add suggestions by ifreund

also remove 2 redundant and outcommented tests

1 files changed, 0 insertions(+), 3 deletions(-)

lib/std/unicode.zig-3
......@@ -164,7 +164,6 @@ pub fn utf8ValidCodepoint(value: u21) bool {
164164
165165/// Returns the length of a supplied UTF-8 string literal in terms of unicode
166166/// codepoints.
167/// Asserts that the data is valid UTF-8.
168167pub fn utf8CountCodepoints(s: []const u8) !usize {
169168 var len: usize = 0;
170169
......@@ -351,7 +350,6 @@ fn testUtf16CountCodepoints() !void {
351350 @as(usize, 5),
352351 try utf16CountCodepoints(utf8ToUtf16LeStringLiteral("こんにちは")),
353352 );
354 // testing.expectError(error.Utf8EncodesSurrogateHalf, utf8CountCodepoints("\xED\xA0\x80"));
355353}
356354
357355test "utf16 count codepoints" {
......@@ -820,7 +818,6 @@ fn testCalcUtf16LeLen() !void {
820818 try testing.expectEqual(@as(usize, 10), try calcUtf16LeLen("abcdefghij"));
821819 try testing.expectEqual(@as(usize, 10), try calcUtf16LeLen("äåéëþüúíóö"));
822820 try testing.expectEqual(@as(usize, 5), try calcUtf16LeLen("こんにちは"));
823 // testing.expectError(error.Utf8EncodesSurrogateHalf, utf8CountCodepoints("\xED\xA0\x80"));
824821}
825822
826823test "calculate utf16 string length of given utf8 string in u16" {