2 # Copyright (c) 2006 Karl Hasselström
3 test_description
='Test the delete command (deleting one patch at a time).'
7 'Initialize the StGIT repository' \
20 'Try to delete a non-existing patch' \
22 [ $(stg applied | wc -l) -eq 1 ] &&
24 [ $(stg applied | wc -l) -eq 1 ]
28 'Try to delete the topmost patch while dirty' \
30 echo dirty >> foo.txt &&
31 [ $(stg applied | wc -l) -eq 1 ] &&
33 [ $(stg applied | wc -l) -eq 1 ] &&
38 'Delete the topmost patch' \
40 [ $(stg applied | wc -l) -eq 1 ] &&
42 [ $(stg applied | wc -l) -eq 0 ]
46 'Create an unapplied patch' \
56 'Delete an unapplied patch' \
58 [ $(stg unapplied | wc -l) -eq 1 ] &&
60 [ $(stg unapplied | wc -l) -eq 0 ]
64 'Create two patches' \
77 'Try to delete a non-topmost applied patch' \
79 [ $(stg applied | wc -l) -eq 2 ] &&
81 [ $(stg applied | wc -l) -eq 2 ]
85 'Create another branch, and put one patch in each branch' \
87 stg branch --create br &&
100 'Delete a patch in another branch' \
102 [ $(stg applied | wc -l) -eq 3 ] &&
103 [ $(stg applied -b br | wc -l) -eq 1 ] &&
104 stg delete -b br baz &&
105 [ $(stg applied | wc -l) -eq 3 ] &&
106 [ $(stg applied -b br | wc -l) -eq 0 ]