From: Michael Orlitzky Date: Tue, 17 Jun 2014 12:42:47 +0000 (-0400) Subject: Derive the GameInfo test file paths from the DTD list. X-Git-Tag: 0.0.6~171 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=7ab10646746d18c3d5c00d4c68e78807197aa560;p=dead%2Fhtsn-import.git Derive the GameInfo test file paths from the DTD list. --- diff --git a/src/TSN/XML/GameInfo.hs b/src/TSN/XML/GameInfo.hs index 8938200..b13edd7 100644 --- a/src/TSN/XML/GameInfo.hs +++ b/src/TSN/XML/GameInfo.hs @@ -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'. --