chiark / gitweb /
Test the 'stg rename' command
authorOnno Kortmann <onno@gmx.net>
Mon, 24 Mar 2008 18:53:49 +0000 (18:53 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Mon, 24 Mar 2008 18:53:49 +0000 (18:53 +0000)
This just tests the few basic cases of the stg rename command.

Signed-off-by: Onno Kortmann <onno@gmx.net>
Signed-off-by: Karl Hasselström <kha@treskal.com>
t/t2900-rename.sh [new file with mode: 0755]

diff --git a/t/t2900-rename.sh b/t/t2900-rename.sh
new file mode 100755 (executable)
index 0000000..5f47f86
--- /dev/null
@@ -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