mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-10 20:05:50 +02:00
Cleanup: fix formatting of test cases
This commit is contained in:
parent
e4c1583fb7
commit
b1f8aa6c9e
1 changed files with 32 additions and 16 deletions
|
@ -16,7 +16,8 @@ func TestCommitPrefixMigrations(t *testing.T) {
|
|||
name: "Empty String",
|
||||
input: "",
|
||||
expected: "",
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Single CommitPrefix Rename",
|
||||
input: `git:
|
||||
commitPrefix:
|
||||
|
@ -28,7 +29,8 @@ func TestCommitPrefixMigrations(t *testing.T) {
|
|||
- pattern: "^\\w+-\\w+.*"
|
||||
replace: '[JIRA $0] '
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Complicated CommitPrefixes Rename",
|
||||
input: `git:
|
||||
commitPrefixes:
|
||||
|
@ -48,11 +50,13 @@ func TestCommitPrefixMigrations(t *testing.T) {
|
|||
- pattern: "^foo.bar*"
|
||||
replace: '[FUN $0] '
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Incomplete Configuration",
|
||||
input: "git:",
|
||||
expected: "git:",
|
||||
}, {
|
||||
},
|
||||
{
|
||||
// This test intentionally uses non-standard indentation to test that the migration
|
||||
// does not change the input.
|
||||
name: "No changes made when already migrated",
|
||||
|
@ -96,7 +100,8 @@ func TestCustomCommandsOutputMigration(t *testing.T) {
|
|||
name: "Empty String",
|
||||
input: "",
|
||||
expected: "",
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Convert subprocess to output=terminal",
|
||||
input: `customCommands:
|
||||
- command: echo 'hello'
|
||||
|
@ -106,7 +111,8 @@ func TestCustomCommandsOutputMigration(t *testing.T) {
|
|||
- command: echo 'hello'
|
||||
output: terminal
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Convert stream to output=log",
|
||||
input: `customCommands:
|
||||
- command: echo 'hello'
|
||||
|
@ -116,7 +122,8 @@ func TestCustomCommandsOutputMigration(t *testing.T) {
|
|||
- command: echo 'hello'
|
||||
output: log
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Convert showOutput to output=popup",
|
||||
input: `customCommands:
|
||||
- command: echo 'hello'
|
||||
|
@ -126,7 +133,8 @@ func TestCustomCommandsOutputMigration(t *testing.T) {
|
|||
- command: echo 'hello'
|
||||
output: popup
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Subprocess wins over the other two",
|
||||
input: `customCommands:
|
||||
- command: echo 'hello'
|
||||
|
@ -138,7 +146,8 @@ func TestCustomCommandsOutputMigration(t *testing.T) {
|
|||
- command: echo 'hello'
|
||||
output: terminal
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Stream wins over showOutput",
|
||||
input: `customCommands:
|
||||
- command: echo 'hello'
|
||||
|
@ -149,7 +158,8 @@ func TestCustomCommandsOutputMigration(t *testing.T) {
|
|||
- command: echo 'hello'
|
||||
output: log
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Explicitly setting to false doesn't create an output=none key",
|
||||
input: `customCommands:
|
||||
- command: echo 'hello'
|
||||
|
@ -790,7 +800,8 @@ func TestAllBranchesLogCmdMigrations(t *testing.T) {
|
|||
name: "Incomplete Configuration Passes uneventfully",
|
||||
input: "git:",
|
||||
expected: "git:",
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Single Cmd with no Cmds",
|
||||
input: `git:
|
||||
allBranchesLogCmd: git log --graph --oneline
|
||||
|
@ -799,7 +810,8 @@ func TestAllBranchesLogCmdMigrations(t *testing.T) {
|
|||
allBranchesLogCmds:
|
||||
- git log --graph --oneline
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Cmd with one existing Cmds",
|
||||
input: `git:
|
||||
allBranchesLogCmd: git log --graph --oneline
|
||||
|
@ -811,7 +823,8 @@ func TestAllBranchesLogCmdMigrations(t *testing.T) {
|
|||
- git log --graph --oneline
|
||||
- git log --graph --oneline --pretty
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Only Cmds set have no changes",
|
||||
input: `git:
|
||||
allBranchesLogCmds:
|
||||
|
@ -821,7 +834,8 @@ func TestAllBranchesLogCmdMigrations(t *testing.T) {
|
|||
allBranchesLogCmds:
|
||||
- git log
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Removes Empty Cmd When at end of yaml",
|
||||
input: `git:
|
||||
allBranchesLogCmds:
|
||||
|
@ -832,7 +846,8 @@ func TestAllBranchesLogCmdMigrations(t *testing.T) {
|
|||
allBranchesLogCmds:
|
||||
- git log --graph --oneline
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Migrates when sequence defined inline",
|
||||
input: `git:
|
||||
allBranchesLogCmds: [foo, bar]
|
||||
|
@ -841,7 +856,8 @@ func TestAllBranchesLogCmdMigrations(t *testing.T) {
|
|||
expected: `git:
|
||||
allBranchesLogCmds: [baz, foo, bar]
|
||||
`,
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "Removes Empty Cmd With Keys Afterwards",
|
||||
input: `git:
|
||||
allBranchesLogCmds:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue