chiark / gitweb /
stgit.el: Add "d" for a few diff commands, similar to git.el
[stgit] / t / t2900-rename.sh
CommitLineData
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
8test_description='stg rename test
9
10Tests some parts of the stg rename command.'
11
12. ./test-lib.sh
13stg init
14
15test_expect_success 'Rename in empty' '
f03004e2 16 command_error stg rename foo
0a03ab45
OK
17'
18
19test_expect_success 'Rename single top-most' '
20 stg new -m foo &&
21 stg rename bar
22'
23# bar
24
25test_expect_success 'Rename non-existing' '
f03004e2 26 command_error stg rename neithersuchpatch norsuchpatch
0a03ab45
OK
27'
28
29test_expect_success 'Rename with two arguments' '
30 stg new -m baz &&
31 stg rename bar foo
32'
33# foo,baz
34
35test_expect_success 'Rename to existing name' '
f03004e2 36 command_error stg rename foo baz
0a03ab45
OK
37'
38
39test_expect_success 'Rename to same name' '
f03004e2 40 command_error stg rename foo foo
0a03ab45
OK
41'
42
43test_expect_success 'Rename top-most when others exist' '
44 stg rename bar
45'
46
cb1570e1
KH
47test_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 54test_done