summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToby Goodwin <toby@paccrat.org>2017-06-23 22:20:02 +0100
committerToby Goodwin <toby@paccrat.org>2017-06-23 22:20:02 +0100
commitdfc639b58490bc5c00da9c17e6c4dc367909b5e5 (patch)
treef24fe2dccbcb716fd52d71b730d250bf391a675f
parent1216df718969c0f856bce9e1adc64bce127eadd9 (diff)
add failing test for github #33 counter intuitive redirection parse
-rw-r--r--trip.rc9
1 files changed, 7 insertions, 2 deletions
diff --git a/trip.rc b/trip.rc
index fb61afb..0d65044 100644
--- a/trip.rc
+++ b/trip.rc
@@ -603,9 +603,14 @@ 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