New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve test shell scripts #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
I've cherry-picked one of the commits (which is actually necessary for the tests to properly run on macOS) and for some of the other changes the tests are not working for me and I suggested a few changes.
The command printing (-x) is needed for all the tests. The short form is more readable.
Makes it easier to override which git-mediate will be run, especially in automatic tests of distro packages.
The == operator is undefined in POSIX shell. Suggested-by: shellcheck See-also: https://www.shellcheck.net/wiki/SC3014
Otherwise they will be subject to globbing and word splitting. Suggested-by: shellcheck See-also: https://www.shellcheck.net/wiki/SC2086
Suggested-by: shellcheck See-also: https://www.shellcheck.net/wiki/SC2250
Avoids altering developer home directories when running tests that alter the per-user git configuration files.
Avoids overly long lines. Suggested-by: bashate
This allows them to be run directly instead of be prefixed with the shell. They are now POSIX shell scripts so use /bin/sh as the shell interpreter.
This way they show up as strings in editor syntax highlighting.
The trap builtin sets a cleanup function to be run at exit. Call the cleanup function before the tests start too. Add more files to be cleaned up too.
In the process of reviewing the test output, I noticed a bug around handling of whitespace chars in filenames (#45). Unfortunately that didn't cause failure of the |
Thanks!
It's good to know that there's a |
Thanks for merging and looking into the spaces issue and NUL option.
…--
bye,
pabs
https://bonedaddy.net/pabs3/
|
set -eux
for all test shell scripts$PATH
instead of a location stored in a variable=
instead of==
within[ ]
tests