From a57d0891f3a2cb25cd7824d2e0a7d620f6288864 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sun, 26 Oct 2025 10:07:57 -0700 Subject: Strings must be valid UTF-8 --- asspb_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'asspb_test.go') diff --git a/asspb_test.go b/asspb_test.go index 2425571..b974b2f 100644 --- a/asspb_test.go +++ b/asspb_test.go @@ -150,6 +150,10 @@ can just span multiple lines"`, desc: "StringHex", msg: `field: '\x0a'`, want: map[string]any{"field": "\n"}, + }, { + desc: "StringHexHighByte", + msg: `field: "\xe4\xb8\x96"`, + want: map[string]any{"field": "δΈ–"}, }, { desc: "StringUnicode", msg: `field: '\u2014'`, @@ -265,6 +269,12 @@ func TestUnmarshal_Invalid(t *testing.T) { }, { desc: "IntLeadingZero", msg: `field: 0644`, + }, { + desc: "InvalidOctal", + msg: `field: "\777"`, + }, { + desc: "InvalidUTF8", + msg: `field: "\x80"`, }} { t.Run(tc.desc, func(t *testing.T) { t.Parallel() -- cgit v1.3.1