Skip to content

Conversation

@Ozoniuss
Copy link

@Ozoniuss Ozoniuss commented Nov 21, 2023

Changes all (remaining) unit tests to use subtests. I pretty much followed the same implementation that some were already using, which is the same as the one from Dave Cheney's blog blog, or one of your own repositories.

This PR is very big, so I did not change anything else except putting the original tests into subtests and fix three (likely) writing issues. To make it easy to find them, see:

  • line 79 in graph_test.go (changed *directed to *undirected)
  • lines 77 and 152 in path_test.go

Some other considerations:

  • I replaced all continue statements with t.SkipNow()
  • This won't work if you want to run the tests in parallel, unless you rebind the testcase variable inside each for loop. Or alternatively it could use the new experimental environment variable, but that is only avaliable in go 1.21.
  • I use gofmt from within Vscode, and some minor formatting differences may show up on the diff. Let me know if you have any formatter preferences

closes #68

@dominikbraun dominikbraun self-requested a review November 26, 2023 09:14
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.

Change unit tests to use subtests

1 participant