From: Michael Orlitzky Date: Mon, 7 Jul 2014 04:39:38 +0000 (-0400) Subject: Use unsafe_read_document in TSN.XML.Weather tests. X-Git-Tag: 0.0.6~6 X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhtsn-import.git;a=commitdiff_plain;h=9a8a222bae7eb08001a99bb693dd20ed8a2693a1 Use unsafe_read_document in TSN.XML.Weather tests. --- diff --git a/src/TSN/XML/Weather.hs b/src/TSN/XML/Weather.hs index 47e931f..c1ec2ef 100644 --- a/src/TSN/XML/Weather.hs +++ b/src/TSN/XML/Weather.hs @@ -52,10 +52,8 @@ import Text.XML.HXT.Core ( filterAxis, followingSiblingAxis, hasName, - readDocument, remNav, runLA, - runX, xp8Tuple, xp9Tuple, xpAttr, @@ -79,9 +77,9 @@ import Xml ( FromXml(..), FromXmlFk(..), ToDb(..), - parse_opts, pickle_unpickle, unpickleable, + unsafe_read_document, unsafe_unpickle ) @@ -703,13 +701,6 @@ test_on_delete_cascade = testGroup "cascading delete tests" actual @?= expected --- | This is used in a few tests to extract an 'XmlTree' from a path. --- -unsafe_get_xmltree :: String -> IO XmlTree -unsafe_get_xmltree path = - fmap head $ runX $ readDocument parse_opts path - - -- | We want to make sure type1 documents are detected as type1, and -- type2 documents detected as type2.. -- @@ -727,7 +718,7 @@ test_types_detected_correctly = False ] where check path desc expected = testCase desc $ do - xmltree <- unsafe_get_xmltree path + xmltree <- unsafe_read_document path let actual = is_type1 xmltree actual @?= expected @@ -748,6 +739,6 @@ test_normal_teams_detected_correctly = False ] where check desc path expected = testCase desc $ do - xmltree <- unsafe_get_xmltree path + xmltree <- unsafe_read_document path let actual = teams_are_normal xmltree actual @?= expected