Fix unmarshal error with tab in multi-line basic string (#355)

Fixes #354
This commit is contained in:
Allen
2020-04-15 20:46:56 +08:00
committed by GitHub
parent 145b18309a
commit e872682c78
3 changed files with 37 additions and 4 deletions
+7
View File
@@ -654,6 +654,13 @@ func TestMultilineString(t *testing.T) {
{Position{6, 9}, tokenEOF, ""},
})
testFlow(t, `foo = """hello world"""`, []token{
{Position{1, 1}, tokenKey, "foo"},
{Position{1, 5}, tokenEqual, "="},
{Position{1, 10}, tokenString, "hello\tworld"},
{Position{1, 24}, tokenEOF, ""},
})
testFlow(t, "key2 = \"\"\"\nThe quick brown \\\n\n\n fox jumps over \\\n the lazy dog.\"\"\"", []token{
{Position{1, 1}, tokenKey, "key2"},
{Position{1, 6}, tokenEqual, "="},