MCPcopy
hub / github.com/go-sql-driver/mysql / TestValuer

Function TestValuer

driver_test.go:726–745  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

724}
725
726func TestValuer(t *testing.T) {
727 runTestsParallel(t, dsn, func(dbt *DBTest, tbl string) {
728 in := testValuer{"a_value"}
729 var out string
730 var rows *sql.Rows
731
732 dbt.mustExec("CREATE TABLE " + tbl + " (value VARCHAR(255)) CHARACTER SET utf8")
733 dbt.mustExec("INSERT INTO "+tbl+" VALUES (?)", in)
734 rows = dbt.mustQuery("SELECT value FROM " + tbl)
735 if rows.Next() {
736 rows.Scan(&out)
737 if in.value != out {
738 dbt.Errorf("Valuer: %v != %s", in, out)
739 }
740 } else {
741 dbt.Errorf("Valuer: no data")
742 }
743 rows.Close()
744 })
745}
746
747type testValuerWithValidation struct {
748 value string

Callers

nothing calls this directly

Calls 6

runTestsParallelFunction · 0.85
mustExecMethod · 0.80
mustQueryMethod · 0.80
ScanMethod · 0.80
NextMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…