]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/GameInfo.hs
Make the game_info schedule_id optional and add a test case for it.
[dead/htsn-import.git] / src / TSN / XML / GameInfo.hs
index 2830295a78d16d898989d0d45df94858c760e3f1..d165c194957c57cac0fe8f11c113a194d5628290 100644 (file)
@@ -102,8 +102,9 @@ data GameInfo =
                           --   They provide foreign keys into any tables storing
                           --   games with their IDs.
 
-    schedule_id :: Int,   -- ^ Required foreign key into any table storing a
-                          --   schedule along with its ID.
+    schedule_id :: Maybe Int, -- ^ Optional key into any table storing a
+                              --   schedule along with its ID. We've noticed
+                              --   them missing in e.g. recapxml.dtd documents.
     time_stamp :: UTCTime,
     xml :: String }
   deriving (Eq, Show)
@@ -190,7 +191,7 @@ test_accessors = testCase "we can access a parsed game_info" $ do
   let a4  = game_id t
   let ex4  = Just 39978
   let a5  = schedule_id t
-  let ex5  = 39978
+  let ex5  = Just 39978
   let a6  = take 9 (xml t)
   let ex6 = "<message>"
   let actual = (a1,a2,a3,a4,a5,a6)