Skip to content

Commit 11f7839

Browse files
committed
Add more unit tests for parameter decoding
1 parent 101d76a commit 11f7839

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stmt/params_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ func TestDecodeParamsGetAll(t *testing.T) {
5252
{` `, nil, nil},
5353
{` :foo`, []string{`bar`}, nil},
5454
{` :'foo`, nil, text.ErrUnterminatedQuotedString},
55+
{` :'型示師`, nil, text.ErrUnterminatedQuotedString},
56+
{` :"型示師`, nil, text.ErrUnterminatedQuotedString},
57+
{` :'型示師 `, nil, text.ErrUnterminatedQuotedString},
58+
{` :"型示師 `, nil, text.ErrUnterminatedQuotedString},
5559
{`:'foo'`, []string{`'bar'`}, nil},
5660
{` :'foo' `, []string{`'bar'`}, nil},
5761
{`:'foo':foo`, []string{`'bar'bar`}, nil},
@@ -86,6 +90,9 @@ func TestDecodeParamsGetAll(t *testing.T) {
8690
{` :'foo''yes':'foo' `, []string{`'bar'yes'bar'`}, nil},
8791
{` :'foo' 'yes' :'foo' `, []string{`'bar'`, `yes`, `'bar'`}, nil},
8892
{` 'yes':'foo':"foo"'blah''no' "\ntest" `, []string{`yes'bar'"bar"blah'no`, "\ntest"}, nil},
93+
{`:型示師:'型示師':"型示師"`, []string{`:型示師:'型示師':"型示師"`}, nil},
94+
{`:型示師 :'型示師' :"型示師"`, []string{`:型示師`, `:'型示師'`, `:"型示師"`}, nil},
95+
{` :型示師 :'型示師' :"型示師" `, []string{`:型示師`, `:'型示師'`, `:"型示師"`}, nil},
8996
}
9097
for i, test := range tests {
9198
t.Run(strconv.Itoa(i), func(t *testing.T) {

0 commit comments

Comments
 (0)