Commit d3f1cfdf authored by Yiannis Tsiouris's avatar Yiannis Tsiouris

Use Test.Framework with HUnit for tests

parent a94c0e8b
......@@ -2,3 +2,5 @@
*~
*.o
*.hi
orbit
OrbitTests
......@@ -3,8 +3,12 @@
orbit: FORCE
ghc --make Bench.hs -o orbit
tests: orbit
ghc -package test-framework -package test-framework-hunit \
-threaded Tests.hs -o OrbitTests
clean:
$(RM) *.swp *~ *.hi *.o
distclean: clean
$(RM) orbit
$(RM) orbit OrbitTests
import Test.HUnit
import Test.Framework (defaultMain, testGroup)
import Test.Framework.Providers.HUnit
import Bench (seq, g13, g124, g1245)
test1 = TestCase (assertEqual "g13 11" "{size,10}" (Bench.seq g13 11))
test2 = TestCase (assertEqual "g124 157" "{size,133}" (Bench.seq g124 157))
test3 = TestCase (assertEqual "g1245 157" "{size,134}" (Bench.seq g1245 157))
main = defaultMain tests
tests = TestList [ TestLabel "seq short" test1
, TestLabel "seq medium" test2
, TestLabel "seq long" test3
tests = [ testGroup "Sequential tests" [
testCase "short" test1,
testCase "intermediate" test2,
testCase "long" test3
]
]
test1 = assertEqual "g13 11" "{size,10}" (Bench.seq g13 11)
test2 = assertEqual "g124 157" "{size,133}" (Bench.seq g124 157)
test3 = assertEqual "g1245 157" "{size,134}" (Bench.seq g1245 157)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment