Closed mbland closed 7 years ago
Note that the "decrease" in coverage is because kcov
isn't recognizing any of the array assignments in libexec/new
as executed code. Coverage of that file is actually 100%, and coverage of the remaining files remains unchanged. Merging.
Closes #142.
The process of testing revealed so much more than just early bugs in the
new
command script itself. See the commit messages for the gory details, but the highlights are:go-core.bash
would report that Bash 4.0 and 4.1 were unsupported. This has been fixed.tests/new.bats
to fail on Bash versions prior to 4.1. As with the other array bug from commits b421c7382fc1dafb4d865d2357276168eac30744 and c6bf1cf46c7816c969a0c5d45a4badeb50963f95, the fix was to declare the array on one line and initialize on the next, rather than declaring and initializing it on the same line.@go.test_compgen
whereby the underlyingcompgen
would, in some cases, happily return a successful status even when no completions were generated.@go.test_compgen
now fails loudly in this case, as you practically never want it to return empty results (otherwise just use the empty string as test data directly).tests/new.bats
test cases only because of a difference in array expansion between Bash versions up to and including 4.2.31 and Bash versions from 4.2.32 on—only when a single-item array is expanded such that it results in the empty string. See the commit message for 5abb59b686ef13894f6979a11931ce007a58e850 for all the juicy details.tests/new.bats
on Windows using the MSYS2 Bash from Git for Windows revealed a bug instub_program_in_path
fromlib/bats/helpers
whereby stubbing a system program likechmod
may result in the program stub itself getting executed as part ofcreate_bats_test_script
. The fix was easy enough, by callingcreate_bats_test_script
before settingPATH
.