bashunit icon indicating copy to clipboard operation
bashunit copied to clipboard

Allow interpolating arguments in data providers output

Open Chemaclass opened this issue 1 year ago • 0 comments

When you use providers, the name of the test is printed next to the data used as argument of the provider. For example:

Screenshot 2024-05-20 at 13 22 10

This ⬆️ was done here: https://github.com/TypedDevs/bashunit/issues/203 (tests examples from fizzbuzz-bashunit)

💡 Idea

Allow interpolating these arguments in the names of the tests through some special syntax, for example ::1::, ::2::...

function test_returns_fizz_when_multiple_of_3_like_::1::_given() { ... }
function test_returns_fizz_when_multiple_of_5_like_::1::_given() { ... }
✓ Passed: Returns fizz when multiple of 3 like '3' given
✓ Passed: Returns fizz when multiple of 3 like '6' given
✓ Passed: Returns fizz when multiple of 5 like '5' given
✓ Passed: Returns fizz when multiple of 5 like '10' given

Chemaclass avatar May 20 '24 11:05 Chemaclass