X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FOdds.hs;h=9672c9ce4a1531c45153a5df1372af3e1766fe35;hb=cb5fd814ce4dbb761ebbff4771f16d97b1910173;hp=8cfe4ce35679eb7bd1fe49d54d3358e109b0085b;hpb=53e5e32d40a16923ba1d362f405015c3a679bfeb;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/Odds.hs b/src/TSN/XML/Odds.hs index 8cfe4ce..9672c9c 100644 --- a/src/TSN/XML/Odds.hs +++ b/src/TSN/XML/Odds.hs @@ -3,7 +3,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} @@ -12,6 +11,7 @@ -- other... disorganized... information. -- module TSN.XML.Odds ( + dtd, pickle_message, -- * Tests odds_tests, @@ -32,7 +32,7 @@ import Database.Groundhog ( (=.), (==.), countAll, - executeRaw, + deleteAll, insert_, migrate, runMigration, @@ -77,6 +77,12 @@ import Xml ( unsafe_unpickle ) +-- | The DTD to which this module corresponds. Used to invoke dbimport. +-- +dtd :: String +dtd = "Odds_XML.dtd" + + -- -- DB/XML data types -- @@ -793,12 +799,12 @@ test_unpickle_succeeds = testGroup "unpickle tests" -- test_on_delete_cascade :: TestTree test_on_delete_cascade = testGroup "cascading delete tests" - [ check "deleting odds deleted its children" + [ check "deleting odds deletes its children" "test/xml/Odds_XML.xml" 13 -- 5 casinos, 8 teams , - check "deleting odds deleted its children (non-int team_id)" + check "deleting odds deletes its children (non-int team_id)" "test/xml/Odds_XML-noninteger-team-id.xml" 51 -- 5 casinos, 46 teams , @@ -830,8 +836,7 @@ test_on_delete_cascade = testGroup "cascading delete tests" migrate e migrate f _ <- dbimport odds - -- No idea how 'delete' works, so do this instead. - executeRaw False "DELETE FROM odds;" [] + deleteAll a count_a <- countAll a count_b <- countAll b count_c <- countAll c