5 if [ "$roothome" = "~root" ]; then
6 echo "~root is not expanded!"
18 if [ "x$result" = "x$expected" ]; then
22 echo "For $code, expected $expected actual $result"
26 testcase 'set -- ${$+~}' '1|/tmp'
27 testcase 'set -- ${$+~/}' '1|/tmp/'
28 testcase 'set -- ${$+~/foo}' '1|/tmp/foo'
29 testcase 'set -- ${$+x~}' '1|x~'
30 testcase 'set -- ${$+~root}' "1|$roothome"
31 testcase 'set -- ${$+"~"}' '1|~'
32 testcase 'set -- ${$+"~/"}' '1|~/'
33 testcase 'set -- ${$+"~/foo"}' '1|~/foo'
34 testcase 'set -- ${$+"x~"}' '1|x~'
35 testcase 'set -- ${$+"~root"}' "1|~root"
36 testcase 'set -- "${$+~}"' '1|~'
37 testcase 'set -- "${$+~/}"' '1|~/'
38 testcase 'set -- "${$+~/foo}"' '1|~/foo'
39 testcase 'set -- "${$+x~}"' '1|x~'
40 testcase 'set -- "${$+~root}"' "1|~root"
41 testcase 'set -- ${HOME#~}' '0|'
43 testcase 'set -- "$h"' '1|/tmp'
45 testcase 'set -- "$f"' '1|/tmp/foo'
46 testcase 'set -- ${f#~}' '1|/foo'
47 testcase 'set -- ${f#~/}' '1|foo'
51 testcase 'set -- ${$+~}' '1|/tmp'
52 testcase 'set -- ${$+~/foo}' '1|/tmp/foo'
53 testcase 'set -- ${$+$h}' '2|/t|p'
54 testcase 'set -- ${HOME#~}' '0|'
58 testcase 'set -- ${$+$t}' '1|~'
63 testcase 'set -- $r' '0|'
68 testcase 'set -- $r' '1|/tmp'
73 testcase 'set -- $r' '0|'
78 testcase 'set -- $r' '0|'
83 testcase 'set -- $r' '1|/foo'
88 testcase 'set -- $r' '1|foo'