mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-23 22:50:41 +02:00
Add tests for moving across an exec todo
These don't work correctly yet, they move it one too far.
This commit is contained in:
parent
b719dc4d8e
commit
49c50fc95c
@ -79,6 +79,25 @@ func TestRebaseCommands_moveTodoDown(t *testing.T) {
|
|||||||
{Command: todo.UpdateRef, Ref: "refs/heads/some_branch"},
|
{Command: todo.UpdateRef, Ref: "refs/heads/some_branch"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
testName: "move across exec todo",
|
||||||
|
todos: []todo.Todo{
|
||||||
|
{Command: todo.Pick, Commit: "1234"},
|
||||||
|
{Command: todo.Exec, ExecCommand: "make test"},
|
||||||
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
|
},
|
||||||
|
todoToMoveDown: Todo{Hash: "5678"},
|
||||||
|
expectedErr: "",
|
||||||
|
expectedTodos: []todo.Todo{
|
||||||
|
/* EXPECTED:
|
||||||
|
{Command: todo.Pick, Commit: "1234"},
|
||||||
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
|
ACTUAL: */
|
||||||
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
|
{Command: todo.Pick, Commit: "1234"},
|
||||||
|
{Command: todo.Exec, ExecCommand: "make test"},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
testName: "skip an invisible todo",
|
testName: "skip an invisible todo",
|
||||||
todos: []todo.Todo{
|
todos: []todo.Todo{
|
||||||
@ -220,6 +239,25 @@ func TestRebaseCommands_moveTodoUp(t *testing.T) {
|
|||||||
{Command: todo.Pick, Commit: "5678"},
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
testName: "move across exec todo",
|
||||||
|
todos: []todo.Todo{
|
||||||
|
{Command: todo.Pick, Commit: "1234"},
|
||||||
|
{Command: todo.Exec, ExecCommand: "make test"},
|
||||||
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
|
},
|
||||||
|
todoToMoveUp: Todo{Hash: "1234"},
|
||||||
|
expectedErr: "",
|
||||||
|
expectedTodos: []todo.Todo{
|
||||||
|
{Command: todo.Exec, ExecCommand: "make test"},
|
||||||
|
/* EXPECTED:
|
||||||
|
{Command: todo.Pick, Commit: "1234"},
|
||||||
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
|
ACTUAL: */
|
||||||
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
|
{Command: todo.Pick, Commit: "1234"},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
testName: "skip an invisible todo",
|
testName: "skip an invisible todo",
|
||||||
todos: []todo.Todo{
|
todos: []todo.Todo{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user