From 3405e8a1d9aca3ba49ead196fae5cdb6002c9b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Fernandes?= Date: Wed, 11 Feb 2026 11:05:19 +0000 Subject: [PATCH] test: \e escape character --- unmarshaler_test.go | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/unmarshaler_test.go b/unmarshaler_test.go index d832ea7..6ddbb32 100644 --- a/unmarshaler_test.go +++ b/unmarshaler_test.go @@ -759,6 +759,48 @@ huey = 'dewey' } }, }, + { + desc: "basic string escape character", + input: `A = "\e"`, + gen: func() test { + type doc struct { + A string + } + + return test{ + target: &doc{}, + expected: &doc{A: "\x1B"}, + } + }, + }, + { + desc: "multiline basic string escape character", + input: `A = """\e"""`, + gen: func() test { + type doc struct { + A string + } + + return test{ + target: &doc{}, + expected: &doc{A: "\x1B"}, + } + }, + }, + { + desc: "escape character combined with bracket", + input: `A = "\e["`, + gen: func() test { + type doc struct { + A string + } + + return test{ + target: &doc{}, + expected: &doc{A: "\x1B["}, + } + }, + }, { desc: "basic string hex escape lowercase letter", input: `A = "\x61"`,