Skip to content

Keep commas in parentheses in test name filters - #852

Open
jadhavgaurav wants to merge 1 commit into
ThrowTheSwitch:masterfrom
jadhavgaurav:fix/test-filter-comma-in-name-779
Open

jadhavgaurav wants to merge 1 commit into
ThrowTheSwitch:masterfrom
jadhavgaurav:fix/test-filter-comma-in-name-779

Conversation

@jadhavgaurav

Copy link
Copy Markdown

The -f, -n and -x filters split their argument at every comma, so test_first(0,0) was read as the two alternatives test_first(0 and 0). With -f this ran unrelated tests such as test_second(0,0), and with -n it ran none.

A comma nested inside parentheses is now part of the name, in both UnityStringArgumentMatches (where the list is split) and IsStringInBiggerString (where a comma ends a match). Comma-separated lists like -f "a,b" work as before. An unbalanced ( keeps the rest of the argument as one name.

Tests: five cases in test_generate_test_runner.rb against a new testRunnerGeneratorParameterizedArgs.c (include, exact match, no match, comma-separated alternatives mixing parameterized and plain names, exclude). All five fail without the change to src/unity.c. rake test:scripts, test:unit, test:fixture, test:memory, test:summary and test:make pass. test:style was not run locally because rubocop and astyle are not installed.

Fixes #779

The -f, -n and -x filters split their argument at every comma, so a
parameterized test name such as test_first(0,0) was treated as the two
alternatives "test_first(0" and "0)". This ran unrelated tests with -f
and no tests at all with -n.

A comma nested inside parentheses is now part of the name. Plain
comma-separated lists behave as before.

Fixes ThrowTheSwitch#779

Signed-off-by: Gaurav Jadhav <gaurav.vjadhav01@gmail.com>
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.

UnityStringArgumentMatches doesn't seem to work properly for parameterized tests

1 participant