diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-11-24 17:43:44 -0800 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-11-24 17:43:44 -0800 |
| commit | 456b784f4ff742bf604340e62c11da47b46b2950 (patch) | |
| tree | 0c8aa5fe9f44c2848247a4f7336548e967db78f0 /ccl_test.go | |
| parent | 36acb0052bde87b82fb6c08d3a57680f8bea4e5f (diff) | |
| download | ccl-456b784f4ff742bf604340e62c11da47b46b2950.tar.zst | |
Disallow control characters in strings
Diffstat (limited to 'ccl_test.go')
| -rw-r--r-- | ccl_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ccl_test.go b/ccl_test.go index e377306..e7405f8 100644 --- a/ccl_test.go +++ b/ccl_test.go @@ -260,6 +260,14 @@ can just span multiple lines"`, msg: `string: '\033'`, want: message{String: "\033"}, }, { + desc: "StringStripCarriageReturn", + msg: "string:'a\r\nb'", + want: message{String: "a\nb"}, + }, { + desc: "StringTab", + msg: "string:'\t'", + want: message{String: "\t"}, + }, { desc: "Message", msg: `message { field: 10 }`, want: message{Message: &nestedMessage{Field: 10}}, @@ -408,6 +416,12 @@ func TestUnmarshal_Invalid(t *testing.T) { desc: "StringBadUnicode", msg: `string:"\ugggg"`, }, { + desc: "StringControlCharacter", + msg: "string:'\a'", + }, { + desc: "StringCarriageReturnNotFollowedByNewline", + msg: "string:'\r'", + }, { desc: "UnterminatedString", msg: `string: '`, }, { |
