X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FHeartbeat.hs;h=4e0ba07f8b3cc15c1ae13e4e18bcb94724cf0955;hb=1f260c118e8da5679820c8cfa489d8fe4a521140;hp=7c62445d1e81f22d1f7788580ceedfcd7fa2683a;hpb=9d2fd74804d0b7720fd8d0b68beafc6c2777c5d1;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/Heartbeat.hs b/src/TSN/XML/Heartbeat.hs index 7c62445..4e0ba07 100644 --- a/src/TSN/XML/Heartbeat.hs +++ b/src/TSN/XML/Heartbeat.hs @@ -3,8 +3,9 @@ -- | Handle documents defined by Heartbeat.dtd. -- module TSN.XML.Heartbeat ( - heartbeat_tests, - verify ) + verify, + -- * Tests + heartbeat_tests ) where -- System imports. @@ -28,6 +29,7 @@ import Xml ( pickle_unpickle, unpickleable ) -- | The data structure that holds the XML representation of a -- Heartbeat message. +-- data Message = Message { xml_file_id :: Int, @@ -38,6 +40,7 @@ data Message = -- | A (un)pickler that turns a Heartbeat XML file into a 'Message' -- and vice-versa. +-- pickle_message :: PU Message pickle_message = xpElem "message" $ @@ -63,8 +66,12 @@ verify xml = do Nothing -> ImportFailed "Could not unpickle document in import_generic." Just _ -> ImportSkipped "Heartbeat received. Thump." +-- +-- Tasty Tests +-- --- * Tasty Tests +-- | A list of all tests for this module. +-- heartbeat_tests :: TestTree heartbeat_tests = testGroup @@ -73,8 +80,9 @@ heartbeat_tests = test_unpickle_succeeds ] --- | Warning: succeess of this test does not mean that unpickling --- succeeded. +-- | If we unpickle something and then pickle it, we should wind up +-- with the same thing we started with. WARNING: succeess of this +-- test does not mean that unpickling succeeded. -- test_pickle_of_unpickle_is_identity :: TestTree test_pickle_of_unpickle_is_identity =