+ maybe_html <- get_xml_from_article article
+
+ case maybe_html of
+
+ Just html -> do
+ result <- parse html
+ case result of
+ Just stuff -> epublish stuff output_handle
+ Nothing -> do
+ _ <- show_help
+ return ()
+
+ Nothing -> do
+ _ <- show_help
+ return ()
+
+
+
+test_current_article_path :: Assertion
+test_current_article_path = do
+ let expected = "https://lwn.net/current"
+ actual <- real_article_path "current"
+ assertEqual "Current article path constructed" expected actual
+
+test_numbered_article_path :: Assertion
+test_numbered_article_path = do
+ let expected = "https://lwn.net/Articles/69"
+ actual <- real_article_path "69" -- I'm twelve
+ assertEqual "Numbered article path constructed" expected actual
+
+
+test_full_article_path :: Assertion
+test_full_article_path = do
+ let expected = "https://lwn.net/Articles/502979/"
+ actual <- real_article_path "https://lwn.net/Articles/502979/"
+ assertEqual "Full article path left alone" expected actual