refactor code
This commit is contained in:
parent
6c33e2a4ea
commit
88f69156e7
@ -49,9 +49,13 @@ runLineByLine spec = do
|
|||||||
gevalLineByLineCore :: Metric -> FilePath -> FilePath -> FilePath -> Sink LineRecord (ResourceT IO) () -> IO ()
|
gevalLineByLineCore :: Metric -> FilePath -> FilePath -> FilePath -> Sink LineRecord (ResourceT IO) () -> IO ()
|
||||||
gevalLineByLineCore metric inputFilePath expectedFilePath outFilePath consum =
|
gevalLineByLineCore metric inputFilePath expectedFilePath outFilePath consum =
|
||||||
runResourceT $
|
runResourceT $
|
||||||
((getZipSource $ (,)
|
((gevalLineByLineSource metric inputFilePath expectedFilePath outFilePath) $$ consum)
|
||||||
|
|
||||||
|
gevalLineByLineSource :: Metric -> FilePath -> FilePath -> FilePath -> Source (ResourceT IO) LineRecord
|
||||||
|
gevalLineByLineSource metric inputFilePath expectedFilePath outFilePath =
|
||||||
|
(getZipSource $ (,)
|
||||||
<$> ZipSource (CL.sourceList [1..])
|
<$> ZipSource (CL.sourceList [1..])
|
||||||
<*> (ZipSource $ recordSource context parserSpec)) =$= CL.mapM (checkStepM evaluateLine) =$= CL.catMaybes $$ consum)
|
<*> (ZipSource $ recordSource context parserSpec)) =$= CL.mapM (checkStepM evaluateLine) =$= CL.catMaybes
|
||||||
where parserSpec = (ParserSpecWithInput (Right . id) (Right . id) (Right . id))
|
where parserSpec = (ParserSpecWithInput (Right . id) (Right . id) (Right . id))
|
||||||
context = (WithInput inputLineSource expectedLineSource outputLineSource)
|
context = (WithInput inputLineSource expectedLineSource outputLineSource)
|
||||||
inputLineSource = fileAsLineSource inputFilePath
|
inputLineSource = fileAsLineSource inputFilePath
|
||||||
|
Loading…
Reference in New Issue
Block a user