Closed rycee closed 1 year ago
@rycee This should be fixed in bats 1.8.0. The relevant fix is: https://github.com/bats-core/bats-core/commit/c8b5bbade301cecb9e8039615a4125269ec24891
Ah, this is reported here. I actually submitted the fix to bats-core
for the test failure in bash-preexec
but haven't recognized that the issue was already reported here. Thank you for the comment. @rcaloras Now I think this issue can be closed.
(And, now I noticed my typo in the commit message s/sepcial/special/
...)
Great. Thanks as always @akinomyoga!
Thanks, I tester just now with bats 1.8.2 and curiously I get
ok 19 preexec should execute a function with IFS defined to local scope
not ok 20 precmd should execute a function with IFS defined to local scope
# (in test file test/bash-preexec.bats, line 272)
# `[ $status -eq 0 ]' failed
ok 21 preexec should set $? to be the exit code of preexec_function
I'm not sure why I overlooked this, but this seems to be an oversight of updating tests in #131. Lines 212 and 248 in test/bash-preexec.bats
seem to have been correctly updated, but line 280 was not updated at that time. I guess this is because this test failure had been hidden by the bug of bats-core
, but it is revealed now that bats-core
is fixed by https://github.com/bats-core/bats-core/pull/650.
@rycee I realized that this is actually already fixed in the master
by @rcaloras 17 hours ago! You can pull the latest master and try it!
@akinomyoga Indeed, with latest master all tests pass. Thanks!
See below for a test run with Bats 1.5.0 (the same run succeeds with Bats 1.4.1). Originally found in a NixOS CI job. This is with bash-preexec 0.4.1 but master fails in the same way.
I'm not completely certain what the cause is but the line
seems problematic. I wonder if not the "merge" in the error above comes from the "merge" in
bats_merge_stdout_and_stderr
?