mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-06 11:02:41 +03:00
Change test to use named struct fields instead of positional fields
This makes the tests a little bit easier to read, the multi-line string literals make this otherwise a little difficult.
This commit is contained in:
@@ -14,24 +14,24 @@ func TestCommitPrefixMigrations(t *testing.T) {
|
|||||||
expected string
|
expected string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"Empty String",
|
name: "Empty String",
|
||||||
"",
|
input: "",
|
||||||
"",
|
expected: "",
|
||||||
}, {
|
}, {
|
||||||
"Single CommitPrefix Rename",
|
name: "Single CommitPrefix Rename",
|
||||||
`
|
input: `
|
||||||
git:
|
git:
|
||||||
commitPrefix:
|
commitPrefix:
|
||||||
pattern: "^\\w+-\\w+.*"
|
pattern: "^\\w+-\\w+.*"
|
||||||
replace: '[JIRA $0] '`,
|
replace: '[JIRA $0] '`,
|
||||||
`
|
expected: `
|
||||||
git:
|
git:
|
||||||
commitPrefix:
|
commitPrefix:
|
||||||
- pattern: "^\\w+-\\w+.*"
|
- pattern: "^\\w+-\\w+.*"
|
||||||
replace: '[JIRA $0] '`,
|
replace: '[JIRA $0] '`,
|
||||||
}, {
|
}, {
|
||||||
"Complicated CommitPrefixes Rename",
|
name: "Complicated CommitPrefixes Rename",
|
||||||
`
|
input: `
|
||||||
git:
|
git:
|
||||||
commitPrefixes:
|
commitPrefixes:
|
||||||
foo:
|
foo:
|
||||||
@@ -40,7 +40,7 @@ git:
|
|||||||
CrazyName!@#$^*&)_-)[[}{f{[]:
|
CrazyName!@#$^*&)_-)[[}{f{[]:
|
||||||
pattern: "^foo.bar*"
|
pattern: "^foo.bar*"
|
||||||
replace: '[FUN $0] '`,
|
replace: '[FUN $0] '`,
|
||||||
`
|
expected: `
|
||||||
git:
|
git:
|
||||||
commitPrefixes:
|
commitPrefixes:
|
||||||
foo:
|
foo:
|
||||||
@@ -50,9 +50,9 @@ git:
|
|||||||
- pattern: "^foo.bar*"
|
- pattern: "^foo.bar*"
|
||||||
replace: '[FUN $0] '`,
|
replace: '[FUN $0] '`,
|
||||||
}, {
|
}, {
|
||||||
"Incomplete Configuration",
|
name: "Incomplete Configuration",
|
||||||
"git:",
|
input: "git:",
|
||||||
"git:",
|
expected: "git:",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user