on master help sign in
Fix views tests on node backend
0a96c6fEdwin Brady
test/Makefile+1−1
@@ -12,7 +12,7 @@ info: runtest
12 @./runtest $(patsubst %.test,%,$@) -q
12 @./runtest $(patsubst %.test,%,$@) -q
13
13
14test_js: runtest
14test_js: runtest
15− @./runtest without tutorial007 sugar004 reg029 reg052 io001 dsl002 io003 effects001 effects002 basic007 basic011 ffi006 ffi007 ffi008 primitives005 primitives006 views001 opts --codegen node
15+ @./runtest without tutorial007 sugar004 reg029 reg052 io001 dsl002 io003 effects001 effects002 basic007 basic011 ffi006 ffi007 ffi008 primitives005 primitives006 opts --codegen node
16
16
17update: runtest
17update: runtest
18 @./runtest all -u
18 @./runtest all -u
test/views001/expected+2−2
@@ -1,3 +1,3 @@
1Sorting list
1Sorting list
2−[-97, -94, -93, -89, -88, -87, -78, -77, -75, -73, -73, -71, -70, -69, -68, -64, -63, -61, -61, -58, -54, -52, -50, -49, -48, -46, -45, -40, -39, -31, -31, -21, -19, -19, -18, -15, -14, -13, -12, -5, -5, -4, -4, -3, -1, 0, 2, 3, 7, 9, 11, 11, 14, 14, 14, 17, 18, 19, 21, 22, 23, 25, 25, 28, 30, 33, 35, 36, 40, 40, 44, 45, 45, 46, 48, 52, 53, 53, 55, 57, 60, 62, 64, 64, 69, 69, 72, 74, 76, 77, 78, 78, 78, 80, 83, 84, 84, 86, 98, 98]
2+[1, 5, 5, 5, 5, 5, 9, 9, 9, 9, 9, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 17, 21, 21, 21, 21, 21, 25, 29, 29, 29, 29, 29, 29, 29, 29, 33, 33, 33, 33, 33, 33, 37, 37, 37, 37, 37, 37, 37, 37, 37, 41, 41, 41, 45, 49, 53, 53, 53, 57, 57, 57, 57, 61, 61, 61, 61, 61, 61, 61, 65, 65, 65, 69, 69, 73, 73, 73, 73, 73, 77, 77, 77, 77, 81, 81, 85, 85, 85, 85, 89, 89, 93, 93, 93, 93, 97, 97, 97, 97]
3−[98, 98, 86, 84, 84, 83, 80, 78, 78, 78, 77, 76, 74, 72, 69, 69, 64, 64, 62, 60, 57, 55, 53, 53, 52, 48, 46, 45, 45, 44, 40, 40, 36, 35, 33, 30, 28, 25, 25, 23, 22, 21, 19, 18, 17, 14, 14, 14, 11, 11, 9, 7, 3, 2, 0, -1, -3, -4, -4, -5, -5, -12, -13, -14, -15, -18, -19, -19, -21, -31, -31, -39, -40, -45, -46, -48, -49, -50, -52, -54, -58, -61, -61, -63, -64, -68, -69, -70, -71, -73, -73, -75, -77, -78, -87, -88, -89, -93, -94, -97]
3+[97, 97, 97, 97, 93, 93, 93, 93, 89, 89, 85, 85, 85, 85, 81, 81, 77, 77, 77, 77, 73, 73, 73, 73, 73, 69, 69, 65, 65, 65, 61, 61, 61, 61, 61, 61, 61, 57, 57, 57, 57, 53, 53, 53, 49, 45, 41, 41, 41, 37, 37, 37, 37, 37, 37, 37, 37, 37, 33, 33, 33, 33, 33, 33, 29, 29, 29, 29, 29, 29, 29, 29, 25, 21, 21, 21, 21, 21, 17, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13, 9, 9, 9, 9, 9, 5, 5, 5, 5, 5, 1]
test/views001/views001.idr+4−2
@@ -25,8 +25,10 @@ mergeSort xs with (splitRec xs)
25
25
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−testList x seed acc = testList (x - 1) (seed * 12345 + 789)
29+testList x seed acc = let seed' = seed * 12345 + 768 `mod` 65536 in
30+ testList (x - 1) seed'
29− ((seed `mod` 100) :: acc)
31+ ((seed' `mod` 100) :: acc)
30
32
31myhead : List a -> a
33myhead : List a -> a
32myhead (x :: xs) = x
34myhead (x :: xs) = x
test/views002/expected+1−1
@@ -1,2 +1,2 @@
1Sorting list
1Sorting list
2−[-97, -94, -93, -89, -88, -87, -78, -77, -75, -73, -73, -71, -70, -69, -68, -64, -63, -61, -61, -58, -54, -52, -50, -49, -48, -46, -45, -40, -39, -31, -31, -21, -19, -19, -18, -15, -14, -13, -12, -5, -5, -4, -4, -3, -1, 0, 2, 3, 7, 9, 11, 11, 14, 14, 14, 17, 18, 19, 21, 22, 23, 25, 25, 28, 30, 33, 35, 36, 40, 40, 44, 45, 45, 46, 48, 52, 53, 53, 55, 57, 60, 62, 64, 64, 69, 69, 72, 74, 76, 77, 78, 78, 78, 80, 83, 84, 84, 86, 98, 98]
2+[1, 5, 5, 5, 5, 5, 9, 9, 9, 9, 9, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 17, 21, 21, 21, 21, 21, 25, 29, 29, 29, 29, 29, 29, 29, 29, 33, 33, 33, 33, 33, 33, 37, 37, 37, 37, 37, 37, 37, 37, 37, 41, 41, 41, 45, 49, 53, 53, 53, 57, 57, 57, 57, 61, 61, 61, 61, 61, 61, 61, 65, 65, 65, 69, 69, 73, 73, 73, 73, 73, 77, 77, 77, 77, 81, 81, 85, 85, 85, 85, 89, 89, 93, 93, 93, 93, 97, 97, 97, 97]
test/views002/views002.idr+4−2
@@ -10,8 +10,10 @@ qsort inp with (filtered (<) inp)
10
10
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−testList x seed acc = testList (x - 1) (seed * 12345 + 789)
14+testList x seed acc = let seed' = seed * 12345 + 768 `mod` 65536 in
15+ testList (x - 1) seed'
14− ((seed `mod` 100) :: acc)
16+ ((seed' `mod` 100) :: acc)
15
17
16myhead : List a -> a
18myhead : List a -> a
17myhead (x :: xs) = x
19myhead (x :: xs) = x