MCPcopy Index your code
hub / github.com/assafmo/SQLiteQueryServer / TestMainEmptyDbParam

Function TestMainEmptyDbParam

main_test.go:451–464  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

449}
450
451func TestMainEmptyDbParam(t *testing.T) {
452 log.SetOutput(&bytes.Buffer{})
453
454 err := cmd([]string{
455 "--query",
456 "SELECT * FROM ip_dns WHERE dns = ?",
457 })
458 if err == nil {
459 t.Fatal(`Should throw an error`)
460 }
461 if !strings.Contains(err.Error(), "Must provide --db param") {
462 t.Fatalf(`Should throw a "Must provide --db param" error: %v`, err)
463 }
464}
465
466func TestMainEmptyQueryParam(t *testing.T) {
467 log.SetOutput(&bytes.Buffer{})

Callers

nothing calls this directly

Calls 1

cmdFunction · 0.85

Tested by

no test coverage detected