From fc3b7254248848d62e52401ad041d58ca6d073f7 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 20 Jul 2025 16:23:30 +0200 Subject: [PATCH] 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. --- pkg/commands/patch/patch_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/commands/patch/patch_test.go b/pkg/commands/patch/patch_test.go index d9d330017..ba21ad158 100644 --- a/pkg/commands/patch/patch_test.go +++ b/pkg/commands/patch/patch_test.go @@ -115,6 +115,17 @@ index 0000000..4e680cc +grape ` +const deletedFile = `diff --git a/newfile b/newfile +deleted file mode 100644 +index 4e680cc1f..000000000 +--- a/newfile ++++ /dev/null +@@ -1,3 +0,0 @@ +-apple +-orange +-grape +` + const addNewlineToPreviouslyEmptyFile = `diff --git a/newfile b/newfile index e69de29..c6568ea 100644 --- a/newfile @@ -554,6 +565,10 @@ func TestParseAndFormatPlain(t *testing.T) { testName: "newFile", patchStr: newFile, }, + { + testName: "deletedFile", + patchStr: deletedFile, + }, { testName: "addNewlineToPreviouslyEmptyFile", patchStr: addNewlineToPreviouslyEmptyFile,