gotestyourself / gotestsum

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
Apache License 2.0
2.03k stars 119 forks source link

Quote test names before they are used within the regex to rerun #338

Closed noBlubb closed 1 year ago

noBlubb commented 1 year ago

Fixes #337: The (sub) test names were not quoted before being used within the regex passed to -run and therefore caused go test to mis-evaluate the expression if there were parentheses contained. Uses https://pkg.go.dev/regexp#QuoteMeta to make it work for a wider range of characters.

noBlubb commented 1 year ago

Nice! Really helps to highlight the expected behavior and not get distracted by other escaping, thank you :)