]> gitweb.michael.orlitzky.com - dead/halcyon.git/blobdiff - src/Html.hs
Bump all dependencies and switch from test-framework to tasty for tests.
[dead/halcyon.git] / src / Html.hs
index f1671a8e57f0fb0401ec7cea8ec5d765a42a6ba3..59876a5b5c0e9fd9f782442a7e5232dee4679ca6 100644 (file)
@@ -3,9 +3,8 @@ module Html (
   replace_entities )
 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 )
 import Text.HTML.TagSoup.Entity ( lookupEntity )
 
 replace_entities :: String -> String
@@ -18,26 +17,23 @@ replace_entities ('&':xs) =
 replace_entities (x:xs) = x : replace_entities xs
 
 
-html_tests :: Test
+html_tests :: TestTree
 html_tests =
-  testGroup "HTML Tests" [ tc1 ]
-  where
-    tc1 = testCase
-            "All entities are replaced correctly."
-            test_replace_entities
+  testGroup "HTML Tests" [ test_replace_entities ]
+
 
-test_replace_entities :: Assertion
+test_replace_entities :: TestTree
 test_replace_entities =
-  assertEqual description expected_text actual_text
+  testCase description $ actual @?= expected
   where
-    description = "All entities are replaced correctly."
-    actual_text =
+    description = "all entities are replaced correctly."
+    actual =
       replace_entities $
         ""The moon is gay……" " ++
         "said <insert the current president of the " ++
         "United States of America>. “It’s " ++
         "OK—–he’s not a real doctor.”"
-    expected_text =
+    expected =
       "\"The moon is gay……\" said <insert " ++
       "the current president of the United States of America>. " ++
       "“It’s OK—–he’s not a real doctor.”"