From 046cb942c23022668e7a8b1e418f0418842e06ab Mon Sep 17 00:00:00 2001 From: Scott Callaway Date: Wed, 12 Apr 2023 12:22:16 +0100 Subject: [PATCH] fix: organise commit test file Pulled this out into a separate commit since it was unrelated to the feature coming behind it. This just cleans up the `commit_test.go` file slightly (for the method that I was working on) so that the tests are built in a way that is slightly more readable - testing each configuration option individually without combining any of them. --- pkg/commands/git_commands/commit_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/commands/git_commands/commit_test.go b/pkg/commands/git_commands/commit_test.go index 713c9fffa..74341bba8 100644 --- a/pkg/commands/git_commands/commit_test.go +++ b/pkg/commands/git_commands/commit_test.go @@ -196,8 +196,8 @@ func TestCommitShowCmdObj(t *testing.T) { testName: "Default case with filter path", filterPath: "file.txt", contextSize: 3, - ignoreWhitespace: true, - expected: `git show --submodule --color=always --unified=3 --no-renames --stat -p 1234567890 --ignore-all-space -- "file.txt"`, + ignoreWhitespace: false, + expected: `git show --submodule --color=always --unified=3 --no-renames --stat -p 1234567890 -- "file.txt"`, }, { testName: "Show diff with custom context size", @@ -206,6 +206,13 @@ func TestCommitShowCmdObj(t *testing.T) { ignoreWhitespace: false, expected: "git show --submodule --color=always --unified=77 --no-renames --stat -p 1234567890", }, + { + testName: "Show diff, ignoring whitespace", + filterPath: "", + contextSize: 77, + ignoreWhitespace: true, + expected: "git show --submodule --color=always --unified=77 --no-renames --stat -p 1234567890 --ignore-all-space", + }, } for _, s := range scenarios {