Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
demoManito committed Mar 18, 2024
1 parent adf114a commit 2b8fd9d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1428,3 +1428,14 @@ func TestQueryScanToArray(t *testing.T) {
t.Error("users[1] should be empty")
}
}

func TestQueryScanOfRowsGteArrayLength(t *testing.T) {
users := [1]*User{}
err := DB.Limit(2).Find(&users).Error
if err != nil {
t.Fatal(err)
}
if users[0] == nil {
t.Error("users[0] not found")
}
}

0 comments on commit 2b8fd9d

Please sign in to comment.