...
1
2
3
4
5 package objabi
6
7 import "testing"
8
9 func TestDecodeArg(t *testing.T) {
10 t.Parallel()
11 tests := []struct {
12 arg, want string
13 }{
14 {"", ""},
15 {"hello", "hello"},
16 {"hello\\n", "hello\n"},
17 {"hello\\nthere", "hello\nthere"},
18 {"hello\\\\there", "hello\\there"},
19 {"\\\\\\n", "\\\n"},
20 }
21 for _, test := range tests {
22 if got := DecodeArg(test.arg); got != test.want {
23 t.Errorf("decodoeArg(%q) = %q, want %q", test.arg, got, test.want)
24 }
25 }
26 }
27
View as plain text