From: Guillaume Pagès Date: Mon, 08 Jun 2015 14:55:08 GMT Subject: [PATCH 4/4] status: add new tests for status during rebase -i Message-ID: <1433775308-5451-2-git-send-email-guillaume.pages@ensimag.grenoble-inp.fr> In-Reply-To: <1433775308-5451-1-git-send-email-guillaume.pages@ensimag.grenoble-inp.fr> Expand test coverage with one or more than two commands done and with zero, one or more than two commands remaining --- t/t7512-status-help.sh | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh index 0c889fa..844ba15 100755 --- a/t/t7512-status-help.sh +++ b/t/t7512-status-help.sh @@ -856,4 +856,92 @@ EOF test_i18ncmp expected actual ' +test_expect_success 'prepare for different number of commits rebased' ' + git reset --hard master && + git checkout -b several_commits && + test_commit one_commit main.txt one && + test_commit two_commit main.txt two && + test_commit three_commit main.txt three && + test_commit four_commit main.txt four +' + + +test_expect_success 'status: one command done nothing remaining' ' + FAKE_LINES=" exec_exit_15" && + export FAKE_LINES && + test_when_finished "git rebase --abort" && + ONTO=$(git rev-parse --short HEAD~3) && + (git rebase -i HEAD~3 || true) && + cat >expected <actual && + test_i18ncmp expected actual +' + +test_expect_success 'status: two commands done with some white lines in done file' ' + FAKE_LINES="1 > exec_exit_15 2 3" && + export FAKE_LINES && + test_when_finished "git rebase --abort" && + ONTO=$(git rev-parse --short HEAD~3) && + COMMIT4=$(git rev-parse HEAD) && + COMMIT3=$(git rev-parse HEAD^) && + COMMIT2=$(git rev-parse HEAD^^) && + (git rebase -i HEAD~3 || true) && + cat >expected <actual && + test_i18ncmp expected actual +' + +test_expect_success 'status: two remaining commands with some white lines in todo file' ' + FAKE_LINES="1 2 exec_exit_15 3 > 4" && + export FAKE_LINES && + test_when_finished "git rebase --abort" && + ONTO=$(git rev-parse --short HEAD~4) && + COMMIT4=$(git rev-parse HEAD) && + COMMIT3=$(git rev-parse HEAD^) && + COMMIT2=$(git rev-parse HEAD^^) && + (git rebase -i HEAD~4 || true) && + cat >expected <actual && + test_i18ncmp expected actual +' + test_done -- 2.4.2.342.gc0899ef