on master help sign in
fix broken tests caused by `mod` precedence
b95c907Michael Morgan
test/views001/views001.idr+1−1
@@ -26,7 +26,7 @@ mergeSort xs with (splitRec xs)
26testList : Int -> Int -> List Int -> List Int
26testList : Int -> Int -> List Int -> List Int
27testList 0 seed acc = acc
27testList 0 seed acc = acc
28-- Need to explicitly mod since different back ends overflow differently
28-- Need to explicitly mod since different back ends overflow differently
29−testList x seed acc = let seed' = seed * 12345 + 768 `mod` 65536 in
29+testList x seed acc = let seed' = (seed * 12345 + 768) `mod` 65536 in
30 testList (x - 1) seed'
30 testList (x - 1) seed'
31 ((seed' `mod` 100) :: acc)
31 ((seed' `mod` 100) :: acc)
32
32
test/views001/views001a.idr+1−1
@@ -13,7 +13,7 @@ mergeSort xs with (splitRec xs)
13testList : Int -> Int -> List Int -> List Int
13testList : Int -> Int -> List Int -> List Int
14testList 0 seed acc = acc
14testList 0 seed acc = acc
15-- Need to explicitly mod since different back ends overflow differently
15-- Need to explicitly mod since different back ends overflow differently
16−testList x seed acc = let seed' = seed * 12345 + 768 `mod` 65536 in
16+testList x seed acc = let seed' = (seed * 12345 + 768) `mod` 65536 in
17 testList (x - 1) seed'
17 testList (x - 1) seed'
18 ((seed' `mod` 100) :: acc)
18 ((seed' `mod` 100) :: acc)
19
19
test/views002/views002.idr+1−1
@@ -11,7 +11,7 @@ qsort inp with (filtered (<) inp)
11testList : Int -> Int -> List Int -> List Int
11testList : Int -> Int -> List Int -> List Int
12testList 0 seed acc = acc
12testList 0 seed acc = acc
13-- Need to explicitly mod since different back ends overflow differently
13-- Need to explicitly mod since different back ends overflow differently
14−testList x seed acc = let seed' = seed * 12345 + 768 `mod` 65536 in
14+testList x seed acc = let seed' = (seed * 12345 + 768) `mod` 65536 in
15 testList (x - 1) seed'
15 testList (x - 1) seed'
16 ((seed' `mod` 100) :: acc)
16 ((seed' `mod` 100) :: acc)
17
17