+
+
+-- | Warning, succeess of this test does not mean that unpickling
+-- succeeded.
+test_pickle_of_unpickle_is_identity :: TestTree
+test_pickle_of_unpickle_is_identity = testGroup "pickle-unpickle tests"
+ [ check "pickle composed with unpickle is the identity"
+ "test/xml/newsxml.xml",
+
+ check "pickle composed with unpickle is the identity (with Editor)"
+ "test/xml/newsxml-with-editor.xml" ]
+ where
+ check desc path = testCase desc $ do
+ (expected :: [MessageXml], actual) <- pickle_unpickle "message" path
+ actual @?= expected
+
+
+test_unpickle_succeeds :: TestTree
+test_unpickle_succeeds = testGroup "unpickle tests"
+ [ check "unpickling succeeds"
+ "test/xml/newsxml.xml",
+
+ check "unpickling succeeds (with Editor)"
+ "test/xml/newsxml-with-editor.xml" ]
+ where
+ check desc path = testCase desc $ do
+ actual <- unpickleable path pickle_message
+ let expected = True
+ actual @?= expected