Commit | Line | Data |
---|---|---|
0a03ab45 OK |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2008 Onno Kortmann | |
4 | # Parts taken from the other test scripts | |
5 | # in this directory. | |
6 | # | |
7 | ||
8 | test_description='stg rename test | |
9 | ||
10 | Tests some parts of the stg rename command.' | |
11 | ||
12 | . ./test-lib.sh | |
13 | stg init | |
14 | ||
15 | test_expect_success 'Rename in empty' ' | |
f03004e2 | 16 | command_error stg rename foo |
0a03ab45 OK |
17 | ' |
18 | ||
19 | test_expect_success 'Rename single top-most' ' | |
20 | stg new -m foo && | |
21 | stg rename bar | |
22 | ' | |
23 | # bar | |
24 | ||
25 | test_expect_success 'Rename non-existing' ' | |
f03004e2 | 26 | command_error stg rename neithersuchpatch norsuchpatch |
0a03ab45 OK |
27 | ' |
28 | ||
29 | test_expect_success 'Rename with two arguments' ' | |
30 | stg new -m baz && | |
31 | stg rename bar foo | |
32 | ' | |
33 | # foo,baz | |
34 | ||
35 | test_expect_success 'Rename to existing name' ' | |
f03004e2 | 36 | command_error stg rename foo baz |
0a03ab45 OK |
37 | ' |
38 | ||
39 | test_expect_success 'Rename to same name' ' | |
f03004e2 | 40 | command_error stg rename foo foo |
0a03ab45 OK |
41 | ' |
42 | ||
43 | test_expect_success 'Rename top-most when others exist' ' | |
44 | stg rename bar | |
45 | ' | |
46 | ||
cb1570e1 KH |
47 | test_expect_failure 'Rename hidden' ' |
48 | stg pop && | |
49 | stg hide bar && | |
50 | stg rename bar pub && | |
51 | test "$(echo $(stg series --all))" = "> foo ! pub" | |
52 | ' | |
53 | ||
0a03ab45 | 54 | test_done |