3 # Copyright (c) 2008 Onno Kortmann
4 # Parts taken from the other test scripts
8 test_description
='stg rename test
10 Tests some parts of the stg rename command.'
15 test_expect_success
'Rename in empty' '
16 command_error stg rename foo 2>&1 |
17 grep -e "No applied top patch to rename exists"
20 test_expect_success
'Rename single top-most' '
26 test_expect_success
'Rename non-existing' '
27 command_error stg rename neithersuchpatch norsuchpatch
30 test_expect_success
'Rename with two arguments' '
36 test_expect_success
'Rename with too many arguments' '
37 command_error stg rename foo bar baz 2>&1 |
38 grep -e "incorrect number of arguments"
41 test_expect_success
'Rename to existing name' '
42 command_error stg rename foo baz 2>&1 |
43 grep -e "Patch \"baz\" already exists"
46 test_expect_success
'Rename to same name' '
47 command_error stg rename foo foo 2>&1 |
48 grep -e "\"To\" name and \"from\" name are the same"
51 test_expect_success
'Rename top-most when others exist' '
55 test_expect_failure
'Rename hidden' '
59 test "$(echo $(stg series --all))" = "> foo ! pub"