]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/Heartbeat.hs
Add separate 'unpickleable' tests to the existing XML modules.
[dead/htsn-import.git] / src / TSN / XML / Heartbeat.hs
index 6cc4931f2ce1f97599526fa8ac7fa589a2d113b5..bcf906955e9d5c19b8d392a7331aa29118f18445 100644 (file)
@@ -20,7 +20,7 @@ import Text.XML.HXT.Core (
   xpWrap )
 
 import TSN.DbImport ( ImportResult(..) )
-import Xml ( pickle_unpickle )
+import Xml ( pickle_unpickle, unpickleable )
 
 data Message =
   Message {
@@ -61,12 +61,24 @@ heartbeat_tests :: TestTree
 heartbeat_tests =
   testGroup
     "Heartbeat tests"
-    [ test_pickle_of_unpickle_is_identity ]
+    [ test_pickle_of_unpickle_is_identity,
+      test_unpickle_succeeds ]
 
 
+-- | Warning, succeess of this test does not mean that unpickling
+--   succeeded.
 test_pickle_of_unpickle_is_identity :: TestTree
 test_pickle_of_unpickle_is_identity =
   testCase "pickle composed with unpickle is the identity" $ do
     let path = "test/xml/Heartbeat.xml"
     (expected :: [Message], actual) <- pickle_unpickle "message" path
     actual @?= expected
+
+
+test_unpickle_succeeds :: TestTree
+test_unpickle_succeeds =
+  testCase "unpickling succeeds" $ do
+  let path = "test/xml/Heartbeat.xml"
+  actual <- unpickleable path pickle_message
+  let expected = True
+  actual @?= expected