From 2b8fd9d127c495ac218233d056fddde6276310e9 Mon Sep 17 00:00:00 2001 From: demoManito <1430482733@qq.com> Date: Mon, 18 Mar 2024 13:59:05 +0800 Subject: [PATCH] add test --- tests/query_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/query_test.go b/tests/query_test.go index c0259a14..70f3fe74 100644 --- a/tests/query_test.go +++ b/tests/query_test.go @@ -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") + } +}