The test relied on the non-builtins not being toybox (or another
multicall binary). A multicall binary will actually look at the
symlinked name (in this case "true") and do what it says on the tin.

Use a tiny shell script instead.
---
 tests/env.test | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
From 6fcc0a5bb63cd7547337401fd616f26e7efcc2b2 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Wed, 10 Jul 2019 14:12:45 -0700
Subject: [PATCH] env.test: fix new test for toybox echo.

The test relied on the non-builtins not being toybox (or another
multicall binary). A multicall binary will actually look at the
symlinked name (in this case "true") and do what it says on the tin.

Use a tiny shell script instead.
---
 tests/env.test | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/env.test b/tests/env.test
index 63b9094d..00b56540 100755
--- a/tests/env.test
+++ b/tests/env.test
@@ -23,6 +23,8 @@ testcmd "why is this allowed" "=BLAH env | grep '^=BLAH\$'" "=BLAH\n" "" ""
 testcmd "replace" "A=foo PATH= `which printenv` A" "foo\n" "" ""
 
 # env bypasses shell builtins
-ln -s "$(which echo)" true
+echo "#!$(which sh)
+echo \$@" > true
+chmod a+x true
 testcmd "norecurse" 'env PATH="$PWD:$PATH" true hello' "hello\n" "" ""
 rm true
-- 
2.22.0.410.gd8fdbe21b5-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to