1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00
This commit is contained in:
Timothy Clem 2017-02-22 15:15:32 -08:00
parent f9c26b3ae4
commit 8c490555ff

View File

@ -98,7 +98,7 @@ testParse path expectedOutput = do
expected <- (Verbatim . stripWhitespace) <$> readFile expectedOutput
actual `shouldBe` expected
testDiff :: Renderer (Record '[Cost, Range, Category, SourceSpan]) -> Both FilePath -> FilePath -> Expectation
testDiff :: Renderer (Record '[Range, Category, SourceSpan]) -> Both FilePath -> FilePath -> Expectation
testDiff renderer paths diff = do
sources <- sequence $ readAndTranscodeFile <$> paths
diff' <- diffFiles parser renderer (sourceBlobs sources)
@ -106,7 +106,7 @@ testDiff renderer paths diff = do
expected <- (Verbatim . stripWhitespace) <$> readFile diff
actual `shouldBe` expected
where
parser = parserWithCost (fst paths)
parser = parserForFilepath (fst paths)
sourceBlobs sources = Source.SourceBlob <$> sources <*> pure mempty <*> paths <*> pure (Just Source.defaultPlainBlob)
stripWhitespace :: Text -> Text