2 test_description
='Test "stg delete --spill"'
5 test_expect_success
'Initialize the StGit repository' '
9 test_expect_success
'Create five applied and three unapplied patches' '
10 for i in 0 1 2 3 4 5 6 7; do
19 test_expect_success
'Try to delete --spill an unapplied patch' '
20 command_error stg delete --spill p7 &&
21 test "$(echo $(stg series))" = "+ p0 + p1 + p2 + p3 > p4 - p5 - p6 - p7" &&
22 test "$(echo $(cat foo))" = "0 1 2 3 4" &&
23 test "$(echo $(git diff-files))" = ""
26 test_expect_success
'Try to delete --spill a non-top patch' '
27 command_error stg delete --spill p2 &&
28 test "$(echo $(stg series))" = "+ p0 + p1 + p2 + p3 > p4 - p5 - p6 - p7" &&
29 test "$(echo $(cat foo))" = "0 1 2 3 4" &&
30 test "$(echo $(git diff-files))" = ""
33 test_expect_success
'Delete --spill one patch' '
34 stg delete --spill p4 &&
35 test "$(echo $(stg series))" = "+ p0 + p1 + p2 > p3 - p5 - p6 - p7" &&
36 test "$(echo $(cat foo))" = "0 1 2 3 4" &&
37 test "$(echo $(git diff-files))" = ""
40 test_expect_success
'Delete --spill several patches' '
41 stg delete --spill p2 p3 p1 &&
42 test "$(echo $(stg series))" = "> p0 - p5 - p6 - p7" &&
43 test "$(echo $(cat foo))" = "0 1 2 3 4" &&
44 test "$(echo $(git diff-files))" = ""