Skip to content

Commit 8cfec3f

Browse files
committed
Adjust PaginationTest for pageSize=50
1 parent d3ac12a commit 8cfec3f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/PaginationTest.hs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
module Main where
22

33
import Control.Monad (unless)
4-
import Distribution.Server.Features.Browse (StartIndex(..), NumElems(..), paginate, PaginationConfig(..))
54
import System.Exit (die)
65

6+
import Distribution.Server.Features.Browse (NumElems(..), PaginationConfig(..), StartIndex(..), paginate)
7+
78
main :: IO ()
89
main = do
910
let res = paginate $ PaginationConfig 10 0
@@ -20,18 +21,18 @@ main = do
2021
unless (res == Nothing) $
2122
die $ "Mismatch 3 " ++ show res
2223

23-
let res = paginate $ PaginationConfig 11 1
24-
unless (res == Just (StartIndex 10, NumElems 1)) $
24+
let res = paginate $ PaginationConfig 51 1
25+
unless (res == Just (StartIndex 50, NumElems 1)) $
2526
die $ "Mismatch 4 " ++ show res
2627

2728
let res = paginate $ PaginationConfig 9 0
2829
unless (res == Just (StartIndex 0, NumElems 9)) $
2930
die $ "Mismatch 5 " ++ show res
3031

31-
let res = paginate $ PaginationConfig 20 0
32-
unless (res == Just (StartIndex 0, NumElems 10)) $
32+
let res = paginate $ PaginationConfig 100 0
33+
unless (res == Just (StartIndex 0, NumElems 50)) $
3334
die $ "Mismatch 6 " ++ show res
3435

35-
let res = paginate $ PaginationConfig 20 1
36-
unless (res == Just (StartIndex 10, NumElems 10)) $
36+
let res = paginate $ PaginationConfig 100 1
37+
unless (res == Just (StartIndex 50, NumElems 50)) $
3738
die $ "Mismatch 7 " ++ show res

0 commit comments

Comments
 (0)