mirror of
https://github.com/github/semantic.git
synced 2024-11-29 02:44:36 +03:00
Expect diff headers
This commit is contained in:
parent
d7db984616
commit
35355a2e91
@ -6,6 +6,7 @@ import Renderer
|
||||
import Split
|
||||
import Unified
|
||||
|
||||
import qualified Source as S
|
||||
import Control.DeepSeq
|
||||
import Data.Bifunctor.Join
|
||||
import qualified Data.ByteString.Char8 as B1
|
||||
@ -78,7 +79,9 @@ testDiff :: Renderer T.Text String -> FilePath -> FilePath -> Maybe FilePath ->
|
||||
testDiff renderer a b diff matcher = do
|
||||
let parser = parserForFilepath a
|
||||
sources <- sequence $ readAndTranscodeFile <$> Join (a, b)
|
||||
actual <- diffFiles parser renderer (runJoin sources)
|
||||
let srcs = runJoin sources
|
||||
let sourceBlobs = (S.SourceBlob (fst srcs) mempty a, S.SourceBlob (snd srcs) mempty b)
|
||||
actual <- diffFiles parser renderer sourceBlobs
|
||||
case diff of
|
||||
Nothing -> actual `deepseq` matcher (actual, actual)
|
||||
Just file -> do
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff --git a/test/diffs/newline-at-eof.A.js b/test/diffs/newline-at-eof.B.js
|
||||
index ..
|
||||
@@ -1,2 +1,4 @@
|
||||
console.log("hello, world");
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff --git a/test/diffs/no-newline-at-eof.A.js b/test/diffs/no-newline-at-eof.B.js
|
||||
index ..
|
||||
@@ -1,1 +1,3 @@
|
||||
console.log("hello, world");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user