comparison tests/test-alias.t @ 13434:b5cc838dd999 stable

alias: add test cases for $ escaping in shell aliases
author Steve Losh <steve@stevelosh.com>
date Thu, 17 Feb 2011 17:15:32 -0500
parents ab93029ab622
children 14d0553bd48b
comparison
equal deleted inserted replaced
13433:0b1bbc46516e 13434:b5cc838dd999
1 $ HGFOO=BAR; export HGFOO
1 $ cat >> $HGRCPATH <<EOF 2 $ cat >> $HGRCPATH <<EOF
2 > [extensions] 3 > [extensions]
3 > graphlog= 4 > graphlog=
4 > 5 >
5 > [alias] 6 > [alias]
32 > idalias = id 33 > idalias = id
33 > idaliaslong = id 34 > idaliaslong = id
34 > idaliasshell = !echo test 35 > idaliasshell = !echo test
35 > parentsshell1 = !echo one 36 > parentsshell1 = !echo one
36 > parentsshell2 = !echo two 37 > parentsshell2 = !echo two
38 > escaped1 = !echo 'test\$\$test'
39 > escaped2 = !echo "HGFOO is \$\$HGFOO"
40 > escaped3 = !echo "\$1 is \$\$\$1"
41 > escaped4 = !echo '\$\$0' '\$\$@'
37 > 42 >
38 > [defaults] 43 > [defaults]
39 > mylog = -q 44 > mylog = -q
40 > lognull = -q 45 > lognull = -q
41 > log = -v 46 > log = -v
275 [255] 280 [255]
276 $ hg -R .. mainalias 281 $ hg -R .. mainalias
277 main 282 main
278 $ hg --cwd .. mainalias 283 $ hg --cwd .. mainalias
279 main 284 main
285
286
287 shell aliases with escaped $ chars
288
289 $ hg escaped1
290 test$test
291 $ hg escaped2
292 HGFOO is BAR
293 $ hg escaped3 HGFOO
294 HGFOO is BAR
295 $ hg escaped4 test
296 $0 $@
280 297
281 298
282 invalid arguments 299 invalid arguments
283 300
284 $ hg rt foo 301 $ hg rt foo