diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-10-26 10:07:57 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-10-26 10:07:57 -0700 |
| commit | a57d0891f3a2cb25cd7824d2e0a7d620f6288864 (patch) | |
| tree | de943b13e4f71943da6c03f3c5cca7ab56d6be30 /asspb_test.go | |
| parent | Refine numeric literal syntax (diff) | |
| download | ccl-a57d0891f3a2cb25cd7824d2e0a7d620f6288864.tar.zst | |
Strings must be valid UTF-8
Diffstat (limited to 'asspb_test.go')
| -rw-r--r-- | asspb_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/asspb_test.go b/asspb_test.go index 2425571..b974b2f 100644 --- a/asspb_test.go +++ b/asspb_test.go @@ -151,6 +151,10 @@ can just span multiple lines"`, 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'`, want: map[string]any{"field": "—"}, @@ -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() |
