1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-10 04:07:18 +02:00

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.
This commit is contained in:
Scott Callaway 2023-04-12 12:22:16 +01:00 committed by Scott Callaway
parent a02b54e1b7
commit 046cb942c2
No known key found for this signature in database
GPG Key ID: 77C1BBDFEA19C613

View File

@ -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 {