Handle JSON Lines files

This commit is contained in:
Filip Gralinski 2019-02-14 22:57:29 +01:00
parent 77312aa5a3
commit c52b613ac4
3 changed files with 6 additions and 5 deletions

View File

@ -141,8 +141,8 @@ expectedFileName = "expected.tsv"
doesExpectedExist :: FilePath -> IO Bool
doesExpectedExist fp = do
ef <- findFilePossiblyCompressed (fp </> expectedFileName)
return $ isJust ef
efs <- mapM (\ext -> findFilePossiblyCompressed (fp </> expectedFileName -<.> ext)) extensionsHandled
return $ not $ null $ catMaybes efs
checkTestDir :: Channel -> (Key Challenge) -> Challenge -> SHA1 -> FilePath -> Handler ()
checkTestDir chan challengeId challenge commit testDir = do

View File

@ -37,7 +37,7 @@ import Options.Applicative
import System.IO (readFile)
import System.FilePath (takeFileName, dropExtensions)
import System.FilePath (takeFileName, dropExtensions, (-<.>))
import Data.Text (pack, unpack)
@ -411,7 +411,8 @@ getOutFilePath repoDir test = repoDir </> (T.unpack $ testName test) </> outFile
findOutFile :: FilePath -> Test -> IO (Maybe FilePath)
findOutFile repoDir test = do
let baseOut = getOutFilePath repoDir test
findFilePossiblyCompressed baseOut
ofs <- mapM (\ext -> findFilePossiblyCompressed (baseOut -<.> ext)) extensionsHandled
return $ listToMaybe $ catMaybes ofs
doesOutExist :: FilePath -> Entity Test -> IO Bool
doesOutExist repoDir (Entity _ test) = do

View File

@ -126,7 +126,7 @@ library
, filemanip
, cryptohash
, markdown
, geval >= 1.13.0.0 && < 1.17
, geval >= 1.16.1.0 && < 1.17
, filepath
, yesod-table
, regex-tdfa