Skip to content

Commit

Permalink
cockroachdb: fix tests with DELETE and LIMIT (#701) (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiam authored Nov 5, 2023
1 parent 5b9a03f commit 1d0115f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion adapter/cockroachdb/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func TestTemplateDelete(t *testing.T) {
assert := assert.New(t)

assert.Equal(
`DELETE FROM "artist" WHERE (name = $1)`,
`DELETE FROM "artist" WHERE (name = $1) LIMIT 1`,
b.DeleteFrom("artist").Where("name = ?", "Chavela Vargas").Limit(1).String(),
)

Expand Down
6 changes: 3 additions & 3 deletions internal/testsuite/generic_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,10 @@ func (s *GenericTestSuite) TestFibonacci() {
s.Equal(uint64(4), total)

// Skipping.
res = res.Offset(1).Limit(2)
resWithLimit := res.Offset(1).Limit(2)

var item2 fibonacci
for res.Next(&item2) {
for resWithLimit.Next(&item2) {
switch item2.Input {
case 5:
case 6:
Expand All @@ -320,7 +320,7 @@ func (s *GenericTestSuite) TestFibonacci() {
s.T().Errorf(`Unexpected item: %v.`, item2)
}
}
err = res.Err()
err = resWithLimit.Err()
s.NoError(err)

err = res.Delete()
Expand Down

0 comments on commit 1d0115f

Please sign in to comment.