mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
Test we've added a nonewline line
This commit is contained in:
parent
14094590a8
commit
df8f7589ee
@ -47,7 +47,7 @@ rowIncrement = fmap lineIncrement
|
||||
-- | Given the before and after sources, render a hunk to a string.
|
||||
showHunk :: Both SourceBlob -> Hunk (SplitDiff a Info) -> String
|
||||
showHunk blobs hunk = if last sourceHunk /= '\n'
|
||||
then sourceHunk ++ "\n\\ No newline at end of file\n"
|
||||
then sourceHunk ++ "\n\\\\ No newline at end of file\n"
|
||||
else sourceHunk
|
||||
where sources = source <$> blobs
|
||||
sourceHunk = header blobs hunk ++ concat (showChange sources <$> changes hunk) ++ showLines (snd sources) ' ' (snd <$> trailingContext hunk)
|
||||
|
1
test/diffs/no-newline-at-eof.A.js
Normal file
1
test/diffs/no-newline-at-eof.A.js
Normal file
@ -0,0 +1 @@
|
||||
console.log("hello, world");
|
3
test/diffs/no-newline-at-eof.B.js
Normal file
3
test/diffs/no-newline-at-eof.B.js
Normal file
@ -0,0 +1,3 @@
|
||||
console.log("hello, world");
|
||||
|
||||
console.log("insertion");
|
@ -2,7 +2,8 @@ diff --git a/test/diffs/no-newline-at-eof.A.js b/test/diffs/no-newline-at-eof.B.
|
||||
index .. 100644
|
||||
--- a/test/diffs/no-newline-at-eof.A.js
|
||||
+++ b/test/diffs/no-newline-at-eof.B.js
|
||||
@@ -1,1 +1,3 @@
|
||||
@@ -1,2 +1,3 @@
|
||||
console.log("hello, world");
|
||||
|
||||
+console.log("insertion");
|
||||
+console.log("insertion");
|
||||
\\ No newline at end of file
|
Loading…
Reference in New Issue
Block a user