Fix multiline basic string parsing
This commit is contained in:
@@ -493,6 +493,7 @@ func (p *parser) parseMultilineBasicString(b []byte) ([]byte, []byte, error) {
|
||||
for ; i < len(token)-3; i++ {
|
||||
c := token[i]
|
||||
if !(c == '\n' || c == '\r' || c == ' ' || c == '\t') {
|
||||
i--
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,6 +192,20 @@ func TestUnmarshal(t *testing.T) {
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
desc: "multiline basic string",
|
||||
input: `A = """\
|
||||
Test"""`,
|
||||
gen: func() test {
|
||||
type doc struct {
|
||||
A string
|
||||
}
|
||||
return test{
|
||||
target: &doc{},
|
||||
expected: &doc{A: "Test"},
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
desc: "kv bool true",
|
||||
input: `A = true`,
|
||||
|
||||
Reference in New Issue
Block a user