aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-22 01:56:07 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-22 01:56:07 -0700
commitf1ffc72a624a31c7c16d5daad28facd40c7f73e2 (patch)
treeb09da656531c8d901ce1a52bb9d96a39d2693205 /test
parent37eee4235de88c708cdce1a200c39387da5bbee3 (diff)
downloadbun-f1ffc72a624a31c7c16d5daad28facd40c7f73e2.tar.gz
bun-f1ffc72a624a31c7c16d5daad28facd40c7f73e2.tar.zst
bun-f1ffc72a624a31c7c16d5daad28facd40c7f73e2.zip
Fix `bun run foo --` by ignoring `--`
Diffstat (limited to '')
-rw-r--r--test/apps/bun-run-check.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/apps/bun-run-check.sh b/test/apps/bun-run-check.sh
index 3f54fa26b..25432c422 100644
--- a/test/apps/bun-run-check.sh
+++ b/test/apps/bun-run-check.sh
@@ -22,6 +22,18 @@ if (($?)); then
exit 1
fi
+# We need to run these tests for two variations:
+# bun run foo "bar"
+# bun run foo -- "bar"
+# the "--" should be ignored
+# in earlier versions of bun, it was required to be present
+
+$BUN_BIN run bash -c ""
+if (($?)); then
+ echo "Bash exported functions are broken"
+ exit 1
+fi
+
# https://github.com/oven-sh/bun/issues/53
rm -f /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt >/dev/null 2>&1
@@ -34,6 +46,17 @@ if (($?)); then
exit 1
fi
+rm -f /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt >/dev/null 2>&1
+
+$BUN_BIN run --silent argv foo bar baz >/tmp/bun-run-out.txt
+npm run --silent argv -- foo bar baz >/tmp/bun-run-out.expected.txt
+
+cmp -s /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt
+if (($?)); then
+ echo "argv failed"
+ exit 1
+fi
+
$BUN_BIN run --silent this-should-work
if (($?)); then