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"`,