changeset 11409:7a6ac83a15b0

revset: add some tests
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Tue, 08 Jun 2010 17:56:57 +0200
parents 534c69494918
children 38d4c9b953fe
files tests/test-revset tests/test-revset.out
diffstat 2 files changed, 62 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revset	Tue Jun 08 17:56:57 2010 +0200
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+try() {
+	echo '% hg debugrevspec' $@
+	hg debugrevspec $@
+}
+
+hg init repo
+cd repo
+hg branch a
+hg ci -m "plain name"
+hg branch b
+hg ci -m "another plain name"
+hg branch a-b-c-
+hg ci -m "with dashes"
+hg branch -- -a-b-c-
+hg ci -m "with leading dash"
+hg branch +a+b+c+
+hg ci -m "with plusses"
+hg branch /a/b/c/
+hg ci -m "with slashes"
+hg branch _a_b_c_
+hg ci -m "with underscores"
+hg branch .a.b.c.
+hg ci -m "with dots"
+
+# names that should work without quoting
+try a
+try b-a
+try _a_b_c_
+try _a_b_c_-a
+try .a.b.c.
+try .a.b.c.-a
+
+# quoting needed
+try '"-a-b-c-"'
+try '"-a-b-c-"-a'
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revset.out	Tue Jun 08 17:56:57 2010 +0200
@@ -0,0 +1,24 @@
+marked working directory as branch a
+marked working directory as branch b
+marked working directory as branch a-b-c-
+marked working directory as branch -a-b-c-
+marked working directory as branch +a+b+c+
+marked working directory as branch /a/b/c/
+marked working directory as branch _a_b_c_
+marked working directory as branch .a.b.c.
+% hg debugrevspec a
+0
+% hg debugrevspec b-a
+1
+% hg debugrevspec _a_b_c_
+6
+% hg debugrevspec _a_b_c_-a
+6
+% hg debugrevspec .a.b.c.
+7
+% hg debugrevspec .a.b.c.-a
+7
+% hg debugrevspec "-a-b-c-"
+3
+% hg debugrevspec "-a-b-c-"-a
+3