Skip to content

Commit fc3b725

Browse files
committed
Add a test case for a deleted file to TestParseAndFormatPlain
Not because it's terribly important to test here (doesn't hurt though), but because it will be useful in the next commit for a new test we're adding there.
1 parent 16231a1 commit fc3b725

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pkg/commands/patch/patch_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,17 @@ index 0000000..4e680cc
115115
+grape
116116
`
117117

118+
const deletedFile = `diff --git a/newfile b/newfile
119+
deleted file mode 100644
120+
index 4e680cc1f..000000000
121+
--- a/newfile
122+
+++ /dev/null
123+
@@ -1,3 +0,0 @@
124+
-apple
125+
-orange
126+
-grape
127+
`
128+
118129
const addNewlineToPreviouslyEmptyFile = `diff --git a/newfile b/newfile
119130
index e69de29..c6568ea 100644
120131
--- a/newfile
@@ -554,6 +565,10 @@ func TestParseAndFormatPlain(t *testing.T) {
554565
testName: "newFile",
555566
patchStr: newFile,
556567
},
568+
{
569+
testName: "deletedFile",
570+
patchStr: deletedFile,
571+
},
557572
{
558573
testName: "addNewlineToPreviouslyEmptyFile",
559574
patchStr: addNewlineToPreviouslyEmptyFile,

0 commit comments

Comments
 (0)