test: fill remaining V1 test coverage
Add JSONB, pointer/filter, MustFetchOne, and dialect logger registration tests for dbxm and dbxp. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -78,3 +78,16 @@ func TestFetchOne_NilWhenEmpty(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.Nil(t, result)
|
||||
}
|
||||
|
||||
func TestMustFetchOne_NotFound(t *testing.T) {
|
||||
errNotFound := errors.New("not found")
|
||||
stmt := mockStatement{
|
||||
queryContextFn: func(_ context.Context, _ any) error {
|
||||
return ErrNoRows
|
||||
},
|
||||
}
|
||||
|
||||
result, err := MustFetchOne[row](mockQueryable{}, stmt, errNotFound)
|
||||
assert.Nil(t, result)
|
||||
assert.ErrorIs(t, err, errNotFound)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user