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

rerun-fails: prevent extra runs when a sub-test fails #343

Closed brycekahle closed 1 year ago

brycekahle commented 1 year ago

Addresses other part of #341

brycekahle commented 1 year ago

I realized that substring matching would cause problems when one test name was a prefix of another that wasn't a subtest.

I handled the top-level of this and was the reason there was TestTop and TestTop2 in the test cases. I'm realizing it may not have worked for nested though:

brycekahle commented 1 year ago

How does this approach look to you? Does this seem correct?

Yes, it seems correct. The approach looks good. Maybe it would be helpful to add a comment explaining the approach?

brycekahle commented 1 year ago

@dnephin looks good to merge to me. Thanks!