Added test file raw_test.go

This commit is contained in:
rankgice 2024-09-30 19:51:44 +08:00
parent 202cbae492
commit fa23822f68
1 changed files with 8 additions and 8 deletions

View File

@ -55,19 +55,19 @@ func TestRawSelect(t *testing.T) {
}, },
{ {
"raw_test4", "raw_test4",
`select * from users where name like "@name" and age = 18`, `select * from users where name like "raw3" and age = @age`,
map[string]interface{}{ map[string]interface{}{
"name": "raw1", "age": 18,
}, },
[]User{ []User{
users[3], users[2],
}, },
}, },
{ {
"raw_test5", "raw_test5",
`select * from users where name like "@name" and age = 18`, `select * from users where name like "@name" and age = @age`,
map[string]interface{}{ map[string]interface{}{
"name": "@raw", "age": 18,
}, },
[]User{ []User{
users[3], users[3],
@ -75,12 +75,12 @@ func TestRawSelect(t *testing.T) {
}, },
{ {
"raw_test6", "raw_test6",
`select * from users where name like "@name" and age = 18`, `select * from users where name like "@age" and age = @age`,
map[string]interface{}{ map[string]interface{}{
"name": "@age", "age": 18,
}, },
[]User{ []User{
users[3], users[4],
}, },
}, },
} }