MCPcopy
hub / github.com/dnote/dnote / MustScan

Function MustScan

pkg/cli/database/testutils.go:39–44  ·  view source on GitHub ↗

MustScan scans the given row and fails a test in case of any errors

(t *testing.T, message string, row *sql.Row, args ...interface{})

Source from the content-addressed store, hash-verified

37
38// MustScan scans the given row and fails a test in case of any errors
39func MustScan(t *testing.T, message string, row *sql.Row, args ...interface{}) {
40 err := row.Scan(args...)
41 if err != nil {
42 t.Fatal(errors.Wrap(errors.Wrap(err, "scanning a row"), message))
43 }
44}
45
46// MustExec executes the given SQL query and fails a test if an error occurs
47func MustExec(t *testing.T, message string, db *DB, query string, args ...interface{}) sql.Result {

Callers 15

TestInitFunction · 0.92
TestAddNoteFunction · 0.92
TestEditNoteFunction · 0.92
TestEditBookFunction · 0.92
TestRemoveNoteFunction · 0.92
TestRemoveBookFunction · 0.92
TestDBPathFlagFunction · 0.92
TestInitSystemKVFunction · 0.92
TestExecute_bump_schemaFunction · 0.92
TestRun_nonfreshFunction · 0.92
TestRun_freshFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestInitFunction · 0.74
TestAddNoteFunction · 0.74
TestEditNoteFunction · 0.74
TestEditBookFunction · 0.74
TestRemoveNoteFunction · 0.74
TestRemoveBookFunction · 0.74
TestDBPathFlagFunction · 0.74
TestInitSystemKVFunction · 0.74
TestExecute_bump_schemaFunction · 0.74
TestRun_nonfreshFunction · 0.74
TestRun_freshFunction · 0.74