X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FSportInfo.hs;h=bfac8527605d988a68ad0ccedc035e92e6c3c3d4;hb=b45f24209ce6f1eb3c24a5f01a71f5940a001c02;hp=17da2e61a65dce05ea7cbd576cb178e058aade3e;hpb=2e387e1e615e510b31a4c8ae38da4e4a718fd352;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/SportInfo.hs b/src/TSN/XML/SportInfo.hs index 17da2e6..bfac852 100644 --- a/src/TSN/XML/SportInfo.hs +++ b/src/TSN/XML/SportInfo.hs @@ -18,7 +18,7 @@ module TSN.XML.SportInfo ( dtds, parse_xml, - sportinfo_tests, + sport_info_tests, -- * WARNING: these are private but exported to silence warnings SportInfoConstructor(..) ) where @@ -76,7 +76,7 @@ dtds = "Cbask_DivII_Team_Stats_XML.dtd", "Cbask_DivIII_Team_Stats_XML.dtd", "CBASK_FGPctXML.dtd", - "CBASK_FoulsXML.dtd", -- no dtd + "CBASK_FoulsXML.dtd", "CBASK_FTPctXML.dtd", -- no dtd "Cbask_Indv_No_Avg_XML.dtd", -- no dtd "Cbask_Indv_Scoring_XML.dtd", -- no dtd @@ -304,8 +304,8 @@ mkPersist tsn_codegen_config [groundhog| -- | A list of all tests for this module. -- -sportinfo_tests :: TestTree -sportinfo_tests = +sport_info_tests :: TestTree +sport_info_tests = testGroup "SportInfo tests" [ test_parse_xml_succeeds, @@ -314,8 +314,8 @@ sportinfo_tests = -- | Sample XML documents for SportInfo types. -- -sportinfo_test_files :: [FilePath] -sportinfo_test_files = +sport_info_test_files :: [FilePath] +sport_info_test_files = [ "test/xml/sportinfo/CBASK_3PPctXML.xml", "test/xml/sportinfo/Cbask_All_Tourn_Teams_XML.xml", "test/xml/sportinfo/CBASK_AssistsXML.xml", @@ -325,16 +325,17 @@ sportinfo_test_files = "test/xml/sportinfo/Cbask_DivII_III_Indv_Stats_XML.xml", "test/xml/sportinfo/Cbask_DivII_Team_Stats_XML.xml", "test/xml/sportinfo/Cbask_DivIII_Team_Stats_XML.xml", - "test/xml/sportinfo/CBASK_FGPctXML.dtd" + "test/xml/sportinfo/CBASK_FGPctXML.xml", + "test/xml/sportinfo/CBASK_FoulsXML.xml" ] --- | Make sure we can parse every element of 'sportinfo_test_files'. +-- | Make sure we can parse every element of 'sport_info_test_files'. -- test_parse_xml_succeeds :: TestTree test_parse_xml_succeeds = - testGroup "parse_xml" $ map check sportinfo_test_files + testGroup "parse_xml" $ map check sport_info_test_files where check t = testCase t $ do x <- unsafe_read_document t @@ -346,14 +347,14 @@ test_parse_xml_succeeds = actual @?= expected --- | Ensure that each element of 'sportinfo_test_files' can be imported +-- | Ensure that each element of 'sport_info_test_files' can be imported -- by counting the total number of database records (after -- importing) and comparing it against the length of --- 'sportinfo_test_files'. +-- 'sport_info_test_files'. -- test_dbimport_succeeds :: TestTree test_dbimport_succeeds = testCase "dbimport succeeds" $ do - xmltrees <- mapM unsafe_read_document sportinfo_test_files + xmltrees <- mapM unsafe_read_document sport_info_test_files let msgs = rights $ map (parse_xml "dummy") xmltrees actual <- withSqliteConn ":memory:" $ runDbConn $ do runMigration silentMigrationLogger $ do @@ -363,4 +364,4 @@ test_dbimport_succeeds = testCase "dbimport succeeds" $ do actual @?= expected where - expected = length sportinfo_test_files + expected = length sport_info_test_files