mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 01:47:51 +08:00
Fix test cases.
This commit is contained in:
parent
35147b3a7e
commit
89c9c5ac93
|
@ -13,7 +13,7 @@ var reprTests = []struct {
|
|||
want string
|
||||
}{
|
||||
{String("233"), "233"},
|
||||
{String("a\nb"), "'a\nb'"},
|
||||
{String("a\nb"), `"a\nb"`},
|
||||
{String("foo bar"), "'foo bar'"},
|
||||
{String("a\x00b"), `"a\x00b"`},
|
||||
{Bool(true), "$true"},
|
||||
|
|
|
@ -10,12 +10,13 @@ var quoteTests = []struct {
|
|||
// Bareword when possible.
|
||||
{"x-y,z@h/d", "x-y,z@h/d"},
|
||||
// Single quote when there is special char but no unprintable.
|
||||
{"x$y[]\nef'", "'x$y[]\nef'''"},
|
||||
{"x$y[]ef'", "'x$y[]ef'''"},
|
||||
// Tilde needs quoting only when appearing at the beginning
|
||||
{"~x", "'~x'"},
|
||||
{"x~", "x~"},
|
||||
// Double quote when there is unprintable char.
|
||||
{"\x1b\"\\", `"\x1b\"\\"`},
|
||||
{"a\nb", `"a\nb"`},
|
||||
{"\x1b\"\\", `"\e\"\\"`},
|
||||
}
|
||||
|
||||
func TestQuote(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user