summaryrefslogtreecommitdiff
path: root/Biz/Test.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-01-15 21:11:30 -0500
committerBen Sima <ben@bsima.me>2021-01-15 21:13:33 -0500
commite77cdc025b0e80049344f258d9ca170d0953d0d7 (patch)
tree71b1a438a8f715992627b644dcba7468ef036a09 /Biz/Test.hs
parent7bb2775667386659402ebb7559c7bc4af46ec268 (diff)
Implement Biz.Test with tasty
Also changes the --test option to a 'test' command. This is because running the tests for a namespace/exe should never be combined with anything else: you either want to run the tests, or not.
Diffstat (limited to 'Biz/Test.hs')
-rw-r--r--Biz/Test.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Biz/Test.hs b/Biz/Test.hs
new file mode 100644
index 0000000..9af8912
--- /dev/null
+++ b/Biz/Test.hs
@@ -0,0 +1,24 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
+module Biz.Test
+ ( Tree,
+ group,
+ unit,
+ (@=?),
+ )
+where
+
+-- : dep tasty
+-- : dep tasty-hunit
+import Alpha hiding (group)
+import qualified Test.Tasty as Tasty
+import Test.Tasty.HUnit ((@=?))
+import qualified Test.Tasty.HUnit as HUnit
+
+type Tree = Tasty.TestTree
+
+group :: Tasty.TestName -> [Tasty.TestTree] -> Tasty.TestTree
+group = Tasty.testGroup
+
+unit :: Tasty.TestName -> HUnit.Assertion -> Tasty.TestTree
+unit = HUnit.testCase