New test: make sure that popping doesn't change patch order
[stgit/ydirson.git] / t / t1203-pop.sh
blob6e49b4d28ffbbe69b0a6cd21ab203b65636719f7
1 #!/bin/sh
2 # Copyright (c) 2007 Karl Hasselström
3 test_description='Test the pop command'
4 . ./test-lib.sh
6 test_expect_success \
7 'Initialize the StGIT repository' \
8 'stg init'
10 test_expect_success \
11 'Create ten patches' '
12 for i in 0 1 2 3 4 5 6 7 8 9; do
13 stg new p$i -m p$i;
14 done &&
15 [ "$(echo $(stg applied))" = "p0 p1 p2 p3 p4 p5 p6 p7 p8 p9" ] &&
16 [ "$(echo $(stg unapplied))" = "" ]
19 test_expect_success \
20 'Pop half the patches' '
21 stg pop -n 5 &&
22 [ "$(echo $(stg applied))" = "p0 p1 p2 p3 p4" ] &&
23 [ "$(echo $(stg unapplied))" = "p5 p6 p7 p8 p9" ]
26 test_expect_success \
27 'Pop the remaining patches' '
28 stg pop -a &&
29 [ "$(echo $(stg applied))" = "" ] &&
30 [ "$(echo $(stg unapplied))" = "p0 p1 p2 p3 p4 p5 p6 p7 p8 p9" ]
33 test_done