diff options
author | Gustav HÃ¥llberg <gustav@virtutech.com> | 2009-11-23 10:19:42 +0100 |
---|---|---|
committer | Karl Wiberg <kha@treskal.com> | 2009-11-23 10:29:32 +0100 |
commit | 08a1d356dc02c02f99a6cc6064a5e425bc0b23c6 (patch) | |
tree | 0eaa71a104b9e5e7755172af7bb831ae185b563a | |
parent | bbd0c1f47a633740ce467e11113c1edf5df52829 (diff) | |
download | stgit-08a1d356dc02c02f99a6cc6064a5e425bc0b23c6.tar.gz |
undo: Add test that "stg undo --hard" leaves the stgit tree in a consistent state
The test currently fails.
Signed-off-by: Gustav HÃ¥llberg <gustav@virtutech.com>
Signed-off-by: Karl Wiberg <kha@treskal.com>
-rwxr-xr-x | t/t3103-undo-hard.sh | 14 |
1 files 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 <<EOF @@ -31,23 +32,26 @@ test_expect_success 'Pop middle patch, creating a conflict' ' conflict stg pop p2 && 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))" ' 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 <<EOF EOF -test_expect_success 'Try to undo with --hard' ' +test_expect_failure 'Try to undo with --hard' ' stg undo --hard && stg status a > 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 |