]> gitweb.michael.orlitzky.com - dead/halcyon.git/blobdiff - src/StringUtils.hs
Rewrite CommandLine to use cmdargs and integrate the command-line and RC file options.
[dead/halcyon.git] / src / StringUtils.hs
index 52b1def19cfc02acde93a24cbf25b5949d4297dd..43e42646764c083ae2ddedac22a36b637709ba59 100644 (file)
@@ -1,8 +1,13 @@
--- |Miscellaneous functions for manipulating string.
-module StringUtils
+-- | Miscellaneous functions for manipulating string.
+module StringUtils (
+  listify,
+  string_utils_tests
+  )
 where
 
-import Test.HUnit
+import Test.Framework (Test, testGroup)
+import Test.Framework.Providers.HUnit (testCase)
+import Test.HUnit (Assertion, assertEqual)
 
 
 -- | Takes a list of strings, call them string1, string2, etc. and
@@ -20,14 +25,20 @@ listify =
       show_with_dot x = (show x) ++ ". "
 
 
+--
+-- Tests
+--
 
-string_utils_tests :: [Test]
-string_utils_tests = [ test_listify ]
-
-
-test_listify :: Test
+test_listify :: Assertion
 test_listify =
-    TestCase $ assertEqual "All items are numbered correctly." expected_items actual_items
-    where
-      actual_items = listify [ "item1", "item2" ]
-      expected_items = ["1. item1", "2. item2" ]
+  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 =
+  testGroup "StringUtils Tests" [ tc1 ]
+  where
+    tc1 = testCase "All items are numbered correctly." test_listify