From 08a1d356dc02c02f99a6cc6064a5e425bc0b23c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gustav=20H=C3=A5llberg?= Date: Mon, 23 Nov 2009 10:19:42 +0100 Subject: [PATCH] undo: Add test that "stg undo --hard" leaves the stgit tree in a consistent state MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The test currently fails. Signed-off-by: Gustav HÃ¥llberg Signed-off-by: Karl Wiberg --- t/t3103-undo-hard.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/t/t3103-undo-hard.sh b/t/t3103-undo-hard.sh index ce71668..2d0f382 100755 --- a/t/t3103-undo-hard.sh +++ b/t/t3103-undo-hard.sh @@ -21,7 +21,8 @@ test_expect_success 'Initialize StGit stack with three patches' ' git commit -a -m p2 && echo 333 >> a && git commit -a -m p3 && - stg uncommit -n 3 + stg uncommit -n 3 && + test "$(stg id)" = "$(stg id $(stg top))" ' cat > expected.txt < actual.txt && test_cmp expected.txt actual.txt && - test "$(echo $(stg series))" = "+ p1 > p3 - p2" + test "$(echo $(stg series))" = "+ p1 > p3 - p2" && + test "$(stg id)" = "$(stg id $(stg top))" ' test_expect_success 'Try to undo without --hard' ' command_error stg undo && stg status a > actual.txt && test_cmp expected.txt actual.txt && - test "$(echo $(stg series))" = "+ p1 > p3 - p2" + test "$(echo $(stg series))" = "+ p1 > p3 - p2" && + test "$(stg id)" = "$(stg id $(stg top))" ' cat > expected.txt < actual.txt && test_cmp expected.txt actual.txt && - test "$(echo $(stg series))" = "> p1 - p2 - p3" + test "$(echo $(stg series))" = "> p1 - p2 - p3" && + test "$(stg id)" = "$(stg id $(stg top))" ' test_done -- 2.11.0