diff options
author | Scott Callaway <github@scottcallaway.co.uk> | 2023-04-12 12:22:16 +0100 |
---|---|---|
committer | Scott Callaway <scott.callaway@uipath.com> | 2023-04-12 12:31:06 +0100 |
commit | 046cb942c23022668e7a8b1e418f0418842e06ab (patch) | |
tree | a7786a1728e42dde63478e278ab61d9a63d57236 /pkg | |
parent | a02b54e1b7e7e8dd8bc1958c11ef4ee4df459ea4 (diff) |
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.
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/commands/git_commands/commit_test.go | 11 |
1 files 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 { |