From 9a8a222bae7eb08001a99bb693dd20ed8a2693a1 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 7 Jul 2014 00:39:38 -0400 Subject: [PATCH] Use unsafe_read_document in TSN.XML.Weather tests. --- src/TSN/XML/Weather.hs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) 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 -- 2.44.2