import Data.Tuple.Curry ( uncurryN )
import Test.Tasty ( TestTree, testGroup )
import Test.Tasty.HUnit ( (@?=), testCase )
import Data.Tuple.Curry ( uncurryN )
import Test.Tasty ( TestTree, testGroup )
import Test.Tasty.HUnit ( (@?=), testCase )
import TSN.DbImport ( ImportResult(..) )
import Xml ( pickle_unpickle, unpickleable )
import TSN.DbImport ( ImportResult(..) )
import Xml ( pickle_unpickle, unpickleable )
pickle_message :: PU Message
pickle_message =
xpElem "message" $
xpWrap (from_tuple, to_tuple) $
pickle_message :: PU Message
pickle_message =
xpElem "message" $
xpWrap (from_tuple, to_tuple) $
--- | Verify (and report) the received heartbeat. We always return
--- Nothing to avoid spurious "successfully imported..." notices.
+-- | Verify (and report) the received heartbeat. We return
+-- 'ImportSkipped' because we want to indicate that we processed the
+-- file but there was nothing to import.
return $ case root_element of
Nothing -> ImportFailed "Could not unpickle document in import_generic."
Just _ -> ImportSkipped "Heartbeat received. Thump."
return $ case root_element of
Nothing -> ImportFailed "Could not unpickle document in import_generic."
Just _ -> ImportSkipped "Heartbeat received. Thump."
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"
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"