summaryrefslogtreecommitdiff
path: root/tests/TestSuite/Util.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TestSuite/Util.hs')
-rw-r--r--tests/TestSuite/Util.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/TestSuite/Util.hs b/tests/TestSuite/Util.hs
new file mode 100644
index 0000000..66f101e
--- /dev/null
+++ b/tests/TestSuite/Util.hs
@@ -0,0 +1,18 @@
+-- | Test utilities
+--
+module TestSuite.Util
+ ( fromAssertions
+ ) where
+
+import Test.Framework
+import Test.Framework.Providers.HUnit
+import Test.HUnit hiding (Test)
+
+import Hakyll.Core.Identifier.Pattern
+
+fromAssertions :: String -- ^ Name
+ -> [Assertion] -- ^ Cases
+ -> [Test] -- ^ Result tests
+fromAssertions name = zipWith testCase names
+ where
+ names = map (\n -> name ++ " [" ++ show n ++ "]") [1 :: Int ..]