test: fix input tests with expect
not covering false negatives
#19518
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
expect
itself doesn't return an exit code based on whether the input is correct or not.Therefore the current tests for command line input using expect will always return
exit_code == 0
.The changes fix and extend the test coverage. They include tests that should fail, update towards being directory independent and using regular V tests.
Additional info that might save some time while testing/reviewing
Example to reproduce the issue locally at current master:
Current related CI for reference:
v/.github/workflows/linux_ci.yml
Lines 102 to 104 in 322ba71
To simplify the following steps move from your vroot into
cd examples/password/
and comment outchdir
inpassword_ci.vsh
Run the test
v ./password_ci.vsh
-> should pass.Change an expected value in
./correct.expect
. E.g.:Re-running the test
v ./password_ci.vsh
will also pass after a short timeout. But it should not pass 🧙🏽♂️.