| Q |
A |
| OS |
Linux (Cygwin on Windows 10) |
| Shell & version |
bash 5.2.21(1)-release |
| bashunit version |
0.39.1 |
Summary
Spying on printf causes coverage information for a given test to be improperly collected (i.e. not collected)
This likely relates to #607
Current behavior
When spying on printf in a test, coverage information for any functions called during the test's execution is not collected properly.
How to reproduce
# source file
function hello_world() {
printf '%s\n' "hello world"
}
# test file
function test_hello_world() {
bashunit::spy printf
hello_world
assert_have_been_called_with printf '%s\n' "hello world"
}
Run bashunit tests/test_hello_world.sh --coverage
Open the coverage report and see that the line printf '%s\n' "hello world" in function hello_world is not marked as being covered.
Expected behavior
Coverage information for all lines is collect properly regardless of what shell builtins have been spied upon
Summary
Spying on printf causes coverage information for a given test to be improperly collected (i.e. not collected)
This likely relates to #607
Current behavior
When spying on
printfin a test, coverage information for any functions called during the test's execution is not collected properly.How to reproduce
Run
bashunit tests/test_hello_world.sh --coverageOpen the coverage report and see that the line
printf '%s\n' "hello world"in functionhello_worldis not marked as being covered.Expected behavior
Coverage information for all lines is collect properly regardless of what shell builtins have been spied upon