-
-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
| Q | A |
|---|---|
| OS | macOS / Linux / Windows |
| Shell | sh / bash / ... |
| bashunit version | 0.14 |
Current behavior
The filter is not working when using full test name (with test_ prefix)
How to reproduce
./bashunit tests/unit/state_test.sh -f test_calculate_total_assertionsExpected behavior
./bashunit tests/unit/state_test.sh -f calculate_total_assertions
# should work as
./bashunit tests/unit/state_test.sh -f test_calculate_total_assertionsHINT
- A test:
# tests/unit/helpers_test.sh
# below: test_get_functions_to_run_with_filter_should_return_matching_functions
function test_get_functions_to_run_with_filter_but_complete_function_name() {
local functions=("prefix_function1" "prefix_function2" "other_function" "prefix_function3")
assert_equals "prefix_function2" "$(helper::get_functions_to_run "prefix" "prefix_function2" "${functions[*]}")"
}- The code:
Insidehelper::get_functions_to_run:61add an OR condition to check that the fn is equal to the filter regex only without the prefix. E.g.:
# src/helpers.sh
|| $fn == ${filter}* Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Type
Projects
Status
Done
