Skip to content
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

Fix filter matching pattern with and without test prefix #302

Merged
merged 8 commits into from
Aug 11, 2024

Conversation

ishuar
Copy link
Contributor

@ishuar ishuar commented Aug 1, 2024

📚 Description

🔖 Changes

I added * in ${prefix}_*${filter} within function helper::get_functions_to_run to keep the match more dynamic even if it's not exactly after the prefix (test).

✅ To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix
  • I updated the documentation to reflect the changes

Additional Notes For Reviewer

Ran Tests Locally to verify changes within the scope of state_test file.

  1. Test with a matching string assertions inside the function name (9 functions have it) ✅
╰─$  ./bashunit tests/unit/state_test.sh -f assertions                                                         
bashunit - 0.14.0
Running tests/unit/state_test.sh
✓ Passed: Add and get assertions passed
✓ Passed: Add and get assertions failed
✓ Passed: Add and get assertions skipped
✓ Passed: Add and get assertions incomplete
✓ Passed: Add and get assertions snapshot
✓ Passed: Add twice and get assertions snapshot
✓ Passed: Initialize assertions count
✓ Passed: Export assertions count
✓ Passed: Calculate total assertions

Tests:      9 passed, 9 total
Assertions: 9 passed, 9 total

 All tests passed 
Time taken: 628 ms
  1. Test with prefix test core issue reported with Filter not working with test_ prefix #299
╰─$ ./bashunit tests/unit/state_test.sh -f test_calculate
bashunit - 0.14.0
Running tests/unit/state_test.sh
✓ Passed: Calculate total assertions

Tests:      1 passed, 1 total
Assertions: 1 passed, 1 total

 All tests passed 
Time taken: 123 ms
  1. Test without prefix and partial matching string in the function name ✅ (similar to [1])
╰─$ ./bashunit tests/unit/state_test.sh -f calculate_total                   
bashunit - 0.14.0
Running tests/unit/state_test.sh
✓ Passed: Calculate total assertions

Tests:      1 passed, 1 total
Assertions: 1 passed, 1 total

 All tests passed 
Time taken: 125 ms

ishuar added 8 commits August 2, 2024 01:13
Signed-off-by: ishuar <ishansharma887@gmail.com>
Signed-off-by: ishuar <ishansharma887@gmail.com>
Signed-off-by: ishuar <ishansharma887@gmail.com>
Signed-off-by: ishuar <ishansharma887@gmail.com>
… within bashunit

Signed-off-by: ishuar <ishansharma887@gmail.com>
Signed-off-by: ishuar <ishansharma887@gmail.com>
Signed-off-by: ishuar <ishansharma887@gmail.com>
Signed-off-by: ishuar <ishansharma887@gmail.com>
Copy link
Member

@Chemaclass Chemaclass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks! 👏🍻

@Chemaclass Chemaclass merged commit bbad495 into TypedDevs:main Aug 11, 2024
7 checks passed
@ishuar ishuar deleted the fix-filter branch August 11, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter not working with test_ prefix
2 participants