1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +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 expected <- (Verbatim . stripWhitespace) <$> readFile expectedOutput
actual `shouldBe` expected 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 testDiff renderer paths diff = do
sources <- sequence $ readAndTranscodeFile <$> paths sources <- sequence $ readAndTranscodeFile <$> paths
diff' <- diffFiles parser renderer (sourceBlobs sources) diff' <- diffFiles parser renderer (sourceBlobs sources)
@ -106,7 +106,7 @@ testDiff renderer paths diff = do
expected <- (Verbatim . stripWhitespace) <$> readFile diff expected <- (Verbatim . stripWhitespace) <$> readFile diff
actual `shouldBe` expected actual `shouldBe` expected
where where
parser = parserWithCost (fst paths) parser = parserForFilepath (fst paths)
sourceBlobs sources = Source.SourceBlob <$> sources <*> pure mempty <*> paths <*> pure (Just Source.defaultPlainBlob) sourceBlobs sources = Source.SourceBlob <$> sources <*> pure mempty <*> paths <*> pure (Just Source.defaultPlainBlob)
stripWhitespace :: Text -> Text stripWhitespace :: Text -> Text