iter: ErrNotFound bug fix

This commit is contained in:
Michał Matczuk
2017-09-22 15:02:12 +02:00
parent eef2c77a26
commit f2af2384ed
2 changed files with 31 additions and 5 deletions

View File

@@ -288,6 +288,16 @@ func TestNotFound(t *testing.T) {
Testtext string
}
t.Run("get cql error", func(t *testing.T) {
var v NotFoundTable
i := gocqlx.Iter(session.Query(`SELECT * FROM not_found_table WRONG`))
err := i.Get(&v)
if err == nil || !strings.Contains(err.Error(), "WRONG") {
t.Fatal(err)
}
})
t.Run("get", func(t *testing.T) {
var v NotFoundTable
i := gocqlx.Iter(session.Query(`SELECT * FROM not_found_table`))
@@ -296,6 +306,16 @@ func TestNotFound(t *testing.T) {
}
})
t.Run("select cql error", func(t *testing.T) {
var v []NotFoundTable
i := gocqlx.Iter(session.Query(`SELECT * FROM not_found_table WRONG`))
err := i.Select(&v)
if err == nil || !strings.Contains(err.Error(), "WRONG") {
t.Fatal(err)
}
})
t.Run("select", func(t *testing.T) {
var v []NotFoundTable
i := gocqlx.Iter(session.Query(`SELECT * FROM not_found_table`))