summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ddb1a25)
In addition to testing the number of applied patches, also test their
order. And test the order of unapplied patches too while we're at it.
Signed-off-by: Karl Hasselström <kha@treskal.com>
stg add foo3.txt &&
stg refresh &&
stg export &&
stg add foo3.txt &&
stg refresh &&
stg export &&
+ stg pop &&
+ [ "$(echo $(stg applied))" = "p1 p2" ] &&
+ [ "$(echo $(stg unapplied))" = "p3" ]
stg branch -c foo base &&
stg new p1 -m p1 &&
stg new p2 -m p2 &&
stg branch -c foo base &&
stg new p1 -m p1 &&
stg new p2 -m p2 &&
- stg new p3 -m p3
- test $(stg applied -c) -eq 3
+ stg new p3 -m p3 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ]
'
test_expect_success \
'Synchronise second patch with the master branch' \
'
stg sync -b master p2 &&
'
test_expect_success \
'Synchronise second patch with the master branch' \
'
stg sync -b master p2 &&
- test $(stg applied -c) -eq 3 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
test $(cat foo2.txt) = "foo2"
'
test $(cat foo2.txt) = "foo2"
'
'Synchronise the first two patches with the master branch' \
'
stg sync -b master -a &&
'Synchronise the first two patches with the master branch' \
'
stg sync -b master -a &&
- test $(stg applied -c) -eq 3 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
test $(cat foo1.txt) = "foo1" &&
test $(cat foo2.txt) = "foo2"
'
test $(cat foo1.txt) = "foo1" &&
test $(cat foo2.txt) = "foo2"
'
'Synchronise all the patches with the exported series' \
'
stg sync -s patches-master/series -a &&
'Synchronise all the patches with the exported series' \
'
stg sync -s patches-master/series -a &&
- test $(stg applied -c) -eq 3 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
test $(cat foo1.txt) = "foo1" &&
test $(cat foo2.txt) = "foo2" &&
test $(cat foo3.txt) = "foo3"
test $(cat foo1.txt) = "foo1" &&
test $(cat foo2.txt) = "foo2" &&
test $(cat foo3.txt) = "foo3"
'Modify the master patches' \
'
stg branch master &&
'Modify the master patches' \
'
stg branch master &&
+ [ "$(echo $(stg applied))" = "p1 p2" ] &&
+ [ "$(echo $(stg unapplied))" = "p3" ] &&
stg goto p1 &&
echo bar1 >> foo1.txt &&
stg refresh &&
stg goto p1 &&
echo bar1 >> foo1.txt &&
stg refresh &&
stg goto p3 &&
echo bar3 >> foo3.txt &&
stg refresh &&
stg goto p3 &&
echo bar3 >> foo3.txt &&
stg refresh &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
stg export &&
stg branch foo
'
stg export &&
stg branch foo
'
'Synchronise second patch with the master branch' \
'
stg sync -b master p2 &&
'Synchronise second patch with the master branch' \
'
stg sync -b master p2 &&
- test $(stg applied -c) -eq 3 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
test $(cat bar2.txt) = "bar2"
'
test $(cat bar2.txt) = "bar2"
'
test_expect_success \
'Restore the stack status after the failed sync' \
'
test_expect_success \
'Restore the stack status after the failed sync' \
'
- test $(stg applied -c) -eq 1 &&
+ [ "$(echo $(stg applied))" = "p1" ] &&
+ [ "$(echo $(stg unapplied))" = "p2 p3" ] &&
stg resolved -a &&
stg refresh &&
stg goto p3
stg resolved -a &&
stg refresh &&
stg goto p3
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ]
test_expect_success \
'Restore the stack status after the failed sync' \
'
test_expect_success \
'Restore the stack status after the failed sync' \
'
- test $(stg applied -c) -eq 3 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
+ stg refresh &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ]