add whitespace escaping for backslash

This commit is contained in:
Gokcehan committed 2016-11-22 22:12:47 +03:00
1 parent 87434d3fe6
commit bfd33f8437
2 files changed
+36 -2

No files matched your search

+24
View File
@@ -41,6 +41,30 @@ var gTests = []struct {
[]Expr{&CallExpr{"echo", []string{"hello world"}}},
},
{
`echo hello\ world`,
[]string{"echo", "hello world", "\n"},
[]Expr{&CallExpr{"echo", []string{"hello world"}}},
},
{
`echo hello\ world`,
[]string{"echo", "hello\tworld", "\n"},
[]Expr{&CallExpr{"echo", []string{"hello\tworld"}}},
},
{
"echo hello\\\nworld",
[]string{"echo", "hello\nworld", "\n"},
[]Expr{&CallExpr{"echo", []string{"hello\nworld"}}},
},
{
`echo hello\aworld`,
[]string{"echo", "helloworld", "\n"},
[]Expr{&CallExpr{"echo", []string{"helloworld"}}},
},
{
"set hidden # trailing comments are allowed",
[]string{"set", "hidden", "\n"},