]> gitweb.michael.orlitzky.com - dead/halcyon.git/blobdiff - src/StringUtils.hs
Bump all dependencies and switch from test-framework to tasty for tests.
[dead/halcyon.git] / src / StringUtils.hs
index 210e230f804060527084e7204fce54c473629765..a9e2625289c65be857d068f35a850e32009369ae 100644 (file)
@@ -4,10 +4,8 @@ module StringUtils (
   string_utils_tests )
 where
 
-import Test.Framework ( Test, testGroup )
-import Test.Framework.Providers.HUnit ( testCase )
-import Test.HUnit ( Assertion, assertEqual )
-
+import Test.Tasty ( TestTree, testGroup )
+import Test.Tasty.HUnit ( (@?=), testCase )
 
 -- | Takes a list of strings, call them string1, string2, etc. and
 --   numbers them like a list. So,
@@ -28,16 +26,13 @@ listify =
 -- Tests
 --
 
-test_listify :: Assertion
-test_listify =
-  assertEqual description expected_items actual_items
-  where
-    description = "All items are numbered correctly."
-    actual_items = listify [ "item1", "item2" ]
-    expected_items = ["1. item1", "2. item2" ]
-
-string_utils_tests :: Test
+string_utils_tests :: TestTree
 string_utils_tests =
-  testGroup "StringUtils Tests" [ tc1 ]
+  testGroup "StringUtils Tests" [ test_listify ]
+
+test_listify :: TestTree
+test_listify = testCase description $ actual @?= expected
   where
-    tc1 = testCase "All items are numbered correctly." test_listify
+    description = "all items are numbered correctly"
+    actual = listify [ "item1", "item2" ]
+    expected = ["1. item1", "2. item2" ]