Truncate results in primitives002 test
Precision varies, and since the test is meant to check the primitives
are implementing what they're supposed to, truncation is okay. This
stops the test failing on 64 bit machines.
commit86bf04c7cfc25fc50c226b286ec44495e7ea2fc7
authorEdwin Brady <ecb10@st-andrews.ac.uk>
dateSat 9 Aug 2014, 14:08 (12 years ago)
parent3a561b2
test/primitives002/expected+6−6
@@ -23,21 +23,21 @@ prim__eqFloat 1.0 1.0
2323prim__floatACos 1.0
24240.0
2525prim__floatATan 1.0
26−0.7853981633974483
26+0.78539816
2727prim__floatCos 1.0
28−0.5403023058681398
28+0.54030230
2929prim__floatFloor 1.0
30301.0
3131prim__floatSin 1.0
32−0.8414709848078965
32+0.84147098
3333prim__floatTan 1.0
34−1.5574077246549023
34+1.55740772
3535prim__floatASin 1.0
36−1.5707963267948966
36+1.57079632
3737prim__floatCeil 1.0
38381.0
3939prim__floatExp 1.0
40−2.718281828459045
40+2.71828182
4141prim__floatLog 1.0
42420.0
4343prim__floatSqrt 1.0
test/primitives002/run+4−2
@@ -4,6 +4,9 @@ HEAD="module Main
44
55import Data.Floats
66
7+strtake : Nat -> String -> String
8+strtake n str = pack (take n (unpack str))
9+
710main : IO ()"
811
912TESTS=("prim__floatToStr 0.0"
@@ -34,8 +37,7 @@ generate_testfile()
3437{
3538cat <<EOF > $1
3639${HEAD}
37−main = do
38− putStrLn $ show $ $2
40+main = putStrLn $ strtake 10 (show $ $2)
3941EOF
4042}
4143