From: Onno Kortmann Date: Mon, 24 Mar 2008 18:53:49 +0000 (+0000) Subject: Test the 'stg rename' command X-Git-Tag: v0.14.2~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/65de4cc08dd734c21383ea92e88d34cee3364f22 Test the 'stg rename' command This just tests the few basic cases of the stg rename command. Signed-off-by: Onno Kortmann Signed-off-by: Karl Hasselström --- diff --git a/t/t2900-rename.sh b/t/t2900-rename.sh new file mode 100755 index 0000000..5f47f86 --- /dev/null +++ b/t/t2900-rename.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Copyright (c) 2008 Onno Kortmann +# Parts taken from the other test scripts +# in this directory. +# + +test_description='stg rename test + +Tests some parts of the stg rename command.' + +. ./test-lib.sh +stg init + +test_expect_success 'Rename in empty' ' + ! stg rename foo +' + +test_expect_success 'Rename single top-most' ' + stg new -m foo && + stg rename bar +' +# bar + +test_expect_success 'Rename non-existing' ' + ! stg rename neithersuchpatch norsuchpatch +' + +test_expect_success 'Rename with two arguments' ' + stg new -m baz && + stg rename bar foo +' +# foo,baz + +test_expect_success 'Rename to existing name' ' + ! stg rename foo baz +' + +test_expect_success 'Rename to same name' ' + ! stg rename foo foo +' + +test_expect_success 'Rename top-most when others exist' ' + stg rename bar +' + +test_done