Skip to content

Commit 627775d

Browse files
committed
Update test case
1 parent 1dcddc8 commit 627775d

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

driver_test.go

+13-5
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,10 @@ func TestValuerWithValidation(t *testing.T) {
547547
var out string
548548
var rows *sql.Rows
549549

550-
dbt.mustExec("CREATE TABLE test (value VARCHAR(255)) CHARACTER SET utf8")
551-
dbt.mustExec("INSERT INTO test VALUES (?)", in)
550+
dbt.mustExec("CREATE TABLE testValuer (value VARCHAR(255)) CHARACTER SET utf8")
551+
dbt.mustExec("INSERT INTO testValuer VALUES (?)", in)
552552

553-
rows = dbt.mustQuery("SELECT value FROM test")
553+
rows = dbt.mustQuery("SELECT value FROM testValuer")
554554
defer rows.Close()
555555

556556
if rows.Next() {
@@ -562,11 +562,19 @@ func TestValuerWithValidation(t *testing.T) {
562562
dbt.Errorf("Valuer: no data")
563563
}
564564

565-
if _, err := dbt.db.Exec("INSERT INTO test VALUES (?)", testValuerWithValidation{""}); err == nil {
565+
if _, err := dbt.db.Exec("INSERT INTO testValuer VALUES (?)", testValuerWithValidation{""}); err == nil {
566566
dbt.Errorf("Failed to check valuer error")
567567
}
568568

569-
dbt.mustExec("DROP TABLE IF EXISTS test")
569+
if _, err := dbt.db.Exec("INSERT INTO testValuer VALUES (?)", nil); err == nil {
570+
dbt.Errorf("Failed to check nil")
571+
}
572+
573+
if _, err := dbt.db.Exec("INSERT INTO testValuer VALUES (?)", map[string]bool{}); err == nil {
574+
dbt.Errorf("Failed to check not valuer")
575+
}
576+
577+
dbt.mustExec("DROP TABLE IF EXISTS testValuer")
570578
})
571579
}
572580

0 commit comments

Comments
 (0)