yash icon indicating copy to clipboard operation
yash copied to clipboard

fsplit-p.tst: export IFS influences run-test.sh

Open sertonix opened this issue 1 year ago • 2 comments

When the fsplit-p.tst exports IFS this variable also effects run-test.sh. https://github.com/magicant/yash/blob/f5bbaad8b751dc16357cf6e5466a98d680d29338/tests/fsplit-p.tst#L14 run-test.sh assumes the default IFS to correctly split diff_opt. https://github.com/magicant/yash/blob/f5bbaad8b751dc16357cf6e5466a98d680d29338/tests/run-test.sh#L311 https://github.com/magicant/yash/blob/f5bbaad8b751dc16357cf6e5466a98d680d29338/tests/run-test.sh#L331

With the changed IFS -U 10000 is passed as a single argument to diff (and not split as normally). The diff implementation of coreutils ignores this error but the one from busybox is more strict.

IFS should probably be unset before word splitting is used in run-test.sh.

sertonix avatar May 03 '24 14:05 sertonix

Nice catch, thanks.

magicant avatar May 03 '24 14:05 magicant

I used this patch for the alpine linux package. Don't know if there is a better way.

--- a/tests/run-test.sh
+++ b/tests/run-test.sh
@@ -305,6 +305,8 @@ testcase() {
             ;;
     esac
 
+    unset -v IFS
+
     # check standard output
     if { <&4; } 2>/dev/null; then
         printf '%% standard output diff:\n'

sertonix avatar May 03 '24 14:05 sertonix