Skip to content

Conversation

@Jacobbrewer1
Copy link

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Go Version Update
  • Dependency Update

Description

This pull request refactors the SetURLVars test helper to improve testing practices and updates its usage in tests. The main focus is to enhance test reliability by leveraging Go's testing.T helper methods and to update the relevant test case accordingly.

Test helper improvements:

  • Updated the SetURLVars function in test_helpers.go to accept a *testing.T parameter and call t.Helper(), improving error reporting and aligning with Go testing conventions.
  • Added necessary imports to test_helpers.go to support the new parameter.

Test case updates:

  • Replaced the ExampleSetURLVars example function in mux_test.go with a proper test function TestExampleSetURLVars that uses the updated SetURLVars helper and asserts the expected value using t.Errorf.

Added/updated tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

Run verifications and test

  • make verify is passing
  • make test is passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant