MCPcopy
hub / github.com/jmoiron/sqlx / TestNilReceiver

Function TestNilReceiver

sqlx_test.go:574–588  ·  sqlx_test.go::TestNilReceiver
(t *testing.T)

Source from the content-addressed store, hash-verified

572}
573
574func TestNilReceiver(t *testing.T) {
575 RunWithSchema(defaultSchema, t, func(db *DB, t *testing.T, now string) {
576 loadDefaultFixture(db, t)
577 var p *Person
578 err := db.Get(p, "SELECT * FROM person LIMIT 1")
579 if err == nil {
580 t.Error("Expected error when getting into nil struct ptr.")
581 }
582 var pp *[]Person
583 err = db.Select(pp, "SELECT * FROM person")
584 if err == nil {
585 t.Error("Expected an error when selecting into nil slice ptr.")
586 }
587 })
588}
589
590func TestNamedQuery(t *testing.T) {
591 var schema = Schema{

Callers

nothing calls this directly

Calls 5

RunWithSchemaFunction · 0.85
loadDefaultFixtureFunction · 0.85
ErrorMethod · 0.80
GetMethod · 0.45
SelectMethod · 0.45

Tested by

no test coverage detected