MCPcopy
hub / github.com/gofiber/fiber / Test_PageInfoSortBy

Function Test_PageInfoSortBy

middleware/paginate/paginate_test.go:141–152  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

139}
140
141func Test_PageInfoSortBy(t *testing.T) {
142 t.Parallel()
143
144 p := NewPageInfo(1, 10, 0, nil)
145 p.SortBy("name", ASC).SortBy("date", DESC)
146
147 require.Len(t, p.Sort, 2)
148 require.Equal(t, "name", p.Sort[0].Field)
149 require.Equal(t, ASC, p.Sort[0].Order)
150 require.Equal(t, "date", p.Sort[1].Field)
151 require.Equal(t, DESC, p.Sort[1].Order)
152}
153
154func Test_PageInfoNextPageURL(t *testing.T) {
155 t.Parallel()

Callers

nothing calls this directly

Calls 3

SortByMethod · 0.95
NewPageInfoFunction · 0.85
LenMethod · 0.65

Tested by

no test coverage detected