diff options
Diffstat (limited to 'trip.rc')
| -rw-r--r-- | trip.rc | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -244,17 +244,17 @@ if (~ `{echo -n} ?) if (!~ `` '' {echo --} $nl) fail echo -- -pwd=`/bin/pwd cdpath=/ { # some local assignments +pwd=`{/bin/pwd -P} cdpath=/ { # some local assignments home=/tmp cd - if (!~ `/bin/pwd `{sh -c 'cd /tmp; /bin/pwd'}) + if (!~ `{/bin/pwd -P} `{sh -c 'cd /tmp; /bin/pwd -P'}) fail could not cd to '$home' cdpath=/ cd tmp - if (!~ `/bin/pwd `{sh -c 'cd /tmp; /bin/pwd'}) + if (!~ `{/bin/pwd -P} `{sh -c 'cd /tmp; /bin/pwd -P'}) fail could not cd to /tmp cd $pwd - if (!~ `/bin/pwd `{sh -c 'cd $pwd; /bin/pwd'}) + if (!~ `{/bin/pwd -P} `{sh -c 'cd $pwd; /bin/pwd -P'}) fail could not cd to current directory! } @@ -597,3 +597,20 @@ x=$tmpdir/qux*/foo ~ $x $tmpdir/qux/foo || { rm -rf $tmpdir/qux; fail broken symlink globbing } rm -rf $tmpdir + +# test support for unquoted = +submatch 'echo foo = bar' 'foo = bar' 'unquoted equals 2' +submatch 'echo foo=bar' 'foo=bar' 'unquoted equals 2' +submatch 'echo foo=' 'foo=' 'unquoted equals 3' +submatch 'echo =bar; whatis -v echo' 'echo=bar' 'unquoted equals 4' + +# test for github issue #34 +X=`{ $rc -ec 'b=true; while($b){b=false}; echo YYY' } +if (! ~ $X YYY) { + fail '"rc -e" exits when condition in the while statement fails in the second iteration' +} + +# test for counter intuitive redirection parse +A=``($nl){ $rc -c 'mkdir / >[2=1] | tr a-z A-Z' } +B=``($nl){ $rc -c '>[2=1] mkdir / | tr a-z A-Z' } +~ $A $B || fail counter intuitive redirection bug, $A '!=' $B |