]> gitweb.michael.orlitzky.com - dead/htsn-import.git/commitdiff
Derive the GameInfo test file paths from the DTD list.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Jun 2014 12:42:47 +0000 (08:42 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Jun 2014 12:42:47 +0000 (08:42 -0400)
src/TSN/XML/GameInfo.hs

index 8938200ec480e7765cd8d75732d3c1a635be7b9c..b13edd78af9c28c8e917fe3e2719a02291b5e6c4 100644 (file)
@@ -21,6 +21,7 @@ where
 
 -- System imports.
 import Data.Either ( rights )
+import Data.String.Utils ( replace )
 import Data.Time.Clock ( UTCTime )
 import Database.Groundhog (
   countAll,
@@ -183,26 +184,10 @@ game_info_tests =
 --
 game_info_test_files :: [FilePath]
 game_info_test_files =
-  [ "test/xml/gameinfo/CBASK_Lineup_XML.xml",
-    "test/xml/gameinfo/cbaskpreviewxml.xml",
-    "test/xml/gameinfo/cflpreviewxml.xml",
-    "test/xml/gameinfo/Matchup_NBA_NHL_XML.xml",
-    "test/xml/gameinfo/MLB_Gaming_Matchup_XML.xml",
-    "test/xml/gameinfo/MLB_Lineup_XML.xml",
-    "test/xml/gameinfo/MLB_Matchup_XML.xml",
-    "test/xml/gameinfo/mlbpreviewxml.xml",
-    "test/xml/gameinfo/MLS_Preview_XML.xml",
-    "test/xml/gameinfo/NBA_Gaming_Matchup_XML.xml",
-    "test/xml/gameinfo/NBALineupXML.xml",
-    "test/xml/gameinfo/NBA_Playoff_Matchup_XML.xml",
-    "test/xml/gameinfo/NCAA_FB_Preview_XML.xml",
-    "test/xml/gameinfo/nbapreviewxml.xml",
-    "test/xml/gameinfo/nflpreviewxml.xml",
-    "test/xml/gameinfo/NFL_NCAA_FB_Matchup_XML.xml",
-    "test/xml/gameinfo/nhlpreviewxml.xml",
-    "test/xml/gameinfo/recapxml.xml",
-    "test/xml/gameinfo/WorldBaseballPreviewXML.xml" ]
-
+  map (change_suffix . add_path) dtds
+  where
+     add_path = ("test/xml/gameinfo/" ++ )
+     change_suffix = replace ".dtd" ".xml"
 
 -- | Make sure we can parse every element of 'game_info_test_files'.
 --