Use single-quotes around string literals. (#934)

This commit is contained in:
Michael Hofmann 2021-10-25 17:09:24 +02:00 committed by GitHub
parent 3bb6941859
commit 98d34f9dc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -1368,16 +1368,16 @@ func TestFunctionRegistration(t *testing.T) {
{"SELECT addf32_64(1.5,1.5)", float64(3)},
{"SELECT not(1)", false},
{"SELECT not(0)", true},
{`SELECT regex("^foo.*", "foobar")`, true},
{`SELECT regex("^foo.*", "barfoobar")`, false},
{`SELECT regex('^foo.*', 'foobar')`, true},
{`SELECT regex('^foo.*', 'barfoobar')`, false},
{"SELECT generic(1)", int64(1)},
{"SELECT generic(1.1)", int64(2)},
{`SELECT generic(NULL)`, int64(3)},
{`SELECT generic("foo")`, int64(4)},
{`SELECT generic('foo')`, int64(4)},
{"SELECT variadic(1,2)", int64(3)},
{"SELECT variadic(1,2,3,4)", int64(10)},
{"SELECT variadic(1,1,1,1,1,1,1,1,1,1)", int64(10)},
{`SELECT variadicGeneric(1,"foo",2.3, NULL)`, int64(4)},
{`SELECT variadicGeneric(1,'foo',2.3, NULL)`, int64(4)},
}
for _, op := range ops {
@ -1487,11 +1487,11 @@ func TestCollationRegistration(t *testing.T) {
populate := []string{
`CREATE TABLE test (s TEXT)`,
`INSERT INTO test VALUES ("aaaa")`,
`INSERT INTO test VALUES ("ffff")`,
`INSERT INTO test VALUES ("qqqq")`,
`INSERT INTO test VALUES ("tttt")`,
`INSERT INTO test VALUES ("zzzz")`,
`INSERT INTO test VALUES ('aaaa')`,
`INSERT INTO test VALUES ('ffff')`,
`INSERT INTO test VALUES ('qqqq')`,
`INSERT INTO test VALUES ('tttt')`,
`INSERT INTO test VALUES ('zzzz')`,
}
for _, stmt := range populate {
if _, err := db.Exec(stmt); err != nil {
@ -1586,7 +1586,7 @@ func TestDeclTypes(t *testing.T) {
t.Fatal("Failed to create table:", err)
}
_, err = sqlite3conn.Exec("insert into foo(name) values(\"bar\")", nil)
_, err = sqlite3conn.Exec("insert into foo(name) values('bar')", nil)
if err != nil {
t.Fatal("Failed to insert:", err)
}