alias: add test cases for $ escaping in shell aliases stable
authorSteve Losh <steve@stevelosh.com>
Thu, 17 Feb 2011 17:15:32 -0500
branchstable
changeset 13434 b5cc838dd999
parent 13433 0b1bbc46516e
child 13435 90d7ce986565
alias: add test cases for $ escaping in shell aliases
tests/test-alias.t
--- a/tests/test-alias.t	Wed Feb 16 17:36:31 2011 -0600
+++ b/tests/test-alias.t	Thu Feb 17 17:15:32 2011 -0500
@@ -1,3 +1,4 @@
+  $ HGFOO=BAR; export HGFOO
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
   > graphlog=
@@ -34,6 +35,10 @@
   > idaliasshell = !echo test
   > parentsshell1 = !echo one
   > parentsshell2 = !echo two
+  > escaped1 = !echo 'test\$\$test'
+  > escaped2 = !echo "HGFOO is \$\$HGFOO"
+  > escaped3 = !echo "\$1 is \$\$\$1"
+  > escaped4 = !echo '\$\$0' '\$\$@'
   > 
   > [defaults]
   > mylog = -q
@@ -279,6 +284,18 @@
   main
 
 
+shell aliases with escaped $ chars
+
+  $ hg escaped1
+  test$test
+  $ hg escaped2
+  HGFOO is BAR
+  $ hg escaped3 HGFOO
+  HGFOO is BAR
+  $ hg escaped4 test
+  $0 $@
+
+
 invalid arguments
 
   $ hg rt foo