Skip to content

Commit

Permalink
More parameter decoding unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Oct 27, 2024
1 parent 11f7839 commit 6dfa93b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions stmt/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ func TestDecodeParamsGetAll(t *testing.T) {
{`:型示師:'型示師':"型示師"`, []string{`:型示師:'型示師':"型示師"`}, nil},
{`:型示師 :'型示師' :"型示師"`, []string{`:型示師`, `:'型示師'`, `:"型示師"`}, nil},
{` :型示師 :'型示師' :"型示師" `, []string{`:型示師`, `:'型示師'`, `:"型示師"`}, nil},
{` :{?foo} `, []string{`TRUE`}, nil},
{` :{?foo_} `, []string{`FALSE`}, nil},
{` :{?型示} `, []string{`TRUE`}, nil},
{` :{?型示師} `, []string{`FALSE`}, nil},
{` :{?型示師 } `, []string{`:{?型示師`, `}`}, nil},
{` :{?foo }`, []string{`:{?foo`, `}`}, nil},
}
for i, test := range tests {
t.Run(strconv.Itoa(i), func(t *testing.T) {
Expand All @@ -111,6 +117,7 @@ func testUnquote(t *testing.T, u *user.User) func(string, bool) (bool, string, e
t.Helper()
f := env.Unquote(u, false, env.Vars{
"foo": "bar",
"型示": "yes",
})
return func(s string, isvar bool) (bool, string, error) {
// t.Logf("test %d %q s: %q, isvar: %t", i, teststr, s, isvar)
Expand Down

0 comments on commit 6dfa93b

Please sign in to comment.