Commit | Line | Data |
---|---|---|
d98a499c RR |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2006 Robin Rosenberg | |
4 | # | |
5 | ||
6 | test_description='Test floating a number of patches to the top of the stack | |
7 | ||
8 | ' | |
9 | ||
10 | . ./test-lib.sh | |
11 | ||
12 | test_expect_success \ | |
13 | 'Initialize the StGIT repository' \ | |
14 | 'stg init && | |
ea5b7bf3 KH |
15 | stg new A -m "a" && echo A >a.txt && git add a.txt && stg refresh && |
16 | stg new B -m "b" && echo B >b.txt && git add b.txt && stg refresh && | |
17 | stg new C -m "c" && echo C >c.txt && git add c.txt && stg refresh && | |
18 | stg new D -m "d" && echo D >d.txt && git add d.txt && stg refresh && | |
19 | stg new E -m "e" && echo E >e.txt && git add e.txt && stg refresh && | |
20 | stg new F -m "f" && echo F >f.txt && git add f.txt && stg refresh && | |
21 | stg new G -m "g" && echo G >g.txt && git add g.txt && stg refresh && | |
d98a499c | 22 | stg pop && |
a8b6b08a | 23 | test "$(echo $(stg applied))" = "A B C D E F" |
d98a499c RR |
24 | ' |
25 | ||
26 | test_expect_success \ | |
27 | 'Float A to top' \ | |
28 | 'stg float A && | |
a8b6b08a | 29 | test "$(echo $(stg applied))" = "B C D E F A" |
d98a499c RR |
30 | ' |
31 | test_expect_success \ | |
32 | 'Float A to top (noop)' \ | |
33 | 'stg float A && | |
a8b6b08a | 34 | test "$(echo $(stg applied))" = "B C D E F A" |
d98a499c RR |
35 | ' |
36 | test_expect_success \ | |
37 | 'Float B C to top' \ | |
38 | 'stg float B C && | |
a8b6b08a | 39 | test "$(echo $(stg applied))" = "D E F A B C" |
d98a499c RR |
40 | ' |
41 | test_expect_success \ | |
42 | 'Float E A to top' \ | |
43 | 'stg float E A && | |
a8b6b08a | 44 | test "$(echo $(stg applied))" = "D F B C E A" |
d98a499c RR |
45 | ' |
46 | test_expect_success \ | |
47 | 'Float E to top' \ | |
48 | 'stg float E && | |
a8b6b08a | 49 | test "$(echo $(stg applied))" = "D F B C A E" |
d98a499c RR |
50 | ' |
51 | test_expect_success \ | |
52 | 'Float G F to top' \ | |
53 | 'stg float G F && | |
a8b6b08a | 54 | test "$(echo $(stg applied))" = "D B C A E G F" |
d98a499c RR |
55 | ' |
56 | test_done |