(t *testing.T)
| 534 | } |
| 535 | |
| 536 | func TestCountParamsZero(t *testing.T) { |
| 537 | db, err := sql.Open("sqlite3", fmt.Sprintf("file:%s?mode=rw&cache=shared&_journal_mode=WAL", testDbPath)) |
| 538 | if err != nil { |
| 539 | t.Fatalf("Should open testDbPath (%s) just fine", testDbPath) |
| 540 | } |
| 541 | defer db.Close() |
| 542 | |
| 543 | db.SetMaxOpenConns(1) |
| 544 | |
| 545 | queryStmt, err := db.Prepare("select * from ip_dns") |
| 546 | if err != nil { |
| 547 | t.Fatal("Should prepare query just fine") |
| 548 | } |
| 549 | |
| 550 | count, err := countParams(queryStmt) |
| 551 | if err != nil { |
| 552 | t.Fatal("Shouldn't throw an error") |
| 553 | } |
| 554 | if count != 0 { |
| 555 | t.Fatal("should return 0") |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | func TestCountParamsNotZero(t *testing.T) { |
| 560 | db, err := sql.Open("sqlite3", fmt.Sprintf("file:%s?mode=rw&cache=shared&_journal_mode=WAL", testDbPath)) |
nothing calls this directly
no test coverage detected