+
+
+-- | Compares the output of (xshow . to_xml) and to_xhtml; they should
+-- match.
+test_to_xml :: Assertion
+test_to_xml = do
+ actual_xml' <- runX . xshow $ to_xml input_article
+ let actual_xml = actual_xml' !! 0
+
+ let expected_xml = to_xhtml input_article
+
+ assertEqual
+ "The to_xml function works on a trivial example"
+ expected_xml
+ actual_xml
+ where
+ t = Title "Hello, world!"
+ bl = Byline $ Just "Breaking News"
+ b = BodyHtml "<p>Hello, world!</p>"
+ input_article = Article t bl b
+
+
+