diff options
Diffstat (limited to 'shell/ash_test/ash-arith')
10 files changed, 25 insertions, 0 deletions
diff --git a/shell/ash_test/ash-arith/arith-ternary-assign.right b/shell/ash_test/ash-arith/arith-ternary-assign.right new file mode 100644 index 0000000..6644d86 --- /dev/null +++ b/shell/ash_test/ash-arith/arith-ternary-assign.right @@ -0,0 +1 @@ +42:42 diff --git a/shell/ash_test/ash-arith/arith-ternary-assign.tests b/shell/ash_test/ash-arith/arith-ternary-assign.tests new file mode 100755 index 0000000..fa18fe7 --- /dev/null +++ b/shell/ash_test/ash-arith/arith-ternary-assign.tests @@ -0,0 +1,3 @@ +exec 2>&1 +a='@' +echo 42:$((a=1?42:3,a)) diff --git a/shell/ash_test/ash-arith/arith-ternary-comma.right b/shell/ash_test/ash-arith/arith-ternary-comma.right new file mode 100644 index 0000000..6644d86 --- /dev/null +++ b/shell/ash_test/ash-arith/arith-ternary-comma.right @@ -0,0 +1 @@ +42:42 diff --git a/shell/ash_test/ash-arith/arith-ternary-comma.tests b/shell/ash_test/ash-arith/arith-ternary-comma.tests new file mode 100755 index 0000000..5e05b58 --- /dev/null +++ b/shell/ash_test/ash-arith/arith-ternary-comma.tests @@ -0,0 +1,3 @@ +exec 2>&1 +x='@' +echo 42:$((1?4:x,20*2+2)) diff --git a/shell/ash_test/ash-arith/arith-ternary-preincr.right b/shell/ash_test/ash-arith/arith-ternary-preincr.right new file mode 100644 index 0000000..6644d86 --- /dev/null +++ b/shell/ash_test/ash-arith/arith-ternary-preincr.right @@ -0,0 +1 @@ +42:42 diff --git a/shell/ash_test/ash-arith/arith-ternary-preincr.tests b/shell/ash_test/ash-arith/arith-ternary-preincr.tests new file mode 100755 index 0000000..3985c70 --- /dev/null +++ b/shell/ash_test/ash-arith/arith-ternary-preincr.tests @@ -0,0 +1,3 @@ +exec 2>&1 +x='@' +echo 42:$((1?42:++x)) diff --git a/shell/ash_test/ash-arith/arith-ternary3.right b/shell/ash_test/ash-arith/arith-ternary3.right new file mode 100644 index 0000000..6644d86 --- /dev/null +++ b/shell/ash_test/ash-arith/arith-ternary3.right @@ -0,0 +1 @@ +42:42 diff --git a/shell/ash_test/ash-arith/arith-ternary3.tests b/shell/ash_test/ash-arith/arith-ternary3.tests new file mode 100755 index 0000000..0bf9f30 --- /dev/null +++ b/shell/ash_test/ash-arith/arith-ternary3.tests @@ -0,0 +1,4 @@ +exec 2>&1 +# "EXPR ?..." should check _evaluated_ EXPR, +# not its last value +echo 42:$((1 < 1 ? -1 : 1 > 1 ? 1 : 42)) diff --git a/shell/ash_test/ash-arith/arith-ternary_nested3.right b/shell/ash_test/ash-arith/arith-ternary_nested3.right new file mode 100644 index 0000000..1a34fde --- /dev/null +++ b/shell/ash_test/ash-arith/arith-ternary_nested3.right @@ -0,0 +1,2 @@ +42:42 +a=2:2 diff --git a/shell/ash_test/ash-arith/arith-ternary_nested3.tests b/shell/ash_test/ash-arith/arith-ternary_nested3.tests new file mode 100755 index 0000000..b69dcc6 --- /dev/null +++ b/shell/ash_test/ash-arith/arith-ternary_nested3.tests @@ -0,0 +1,6 @@ +exec 2>&1 +x='@' +a=2 +# After processing nested ?:, outermost ?: should still rememeber to NOT evaluate a*=2 +echo 42:$((1?0?41:42:(a*=2))) +echo "a=2:$a" |