Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

The params_test.go file contained tests for the mask() function, which is a private function defined in refrax_client.go. Private functions should not be tested separately, and these tests were unrelated to the params package.

Changes:

  • Removed 7 TestMask_* test functions from internal/client/params_test.go
  • Retained all TestNewMockParams_* tests which properly test the public API of params.go

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] WIP on new test for params.go based on review feedback Remove private function tests from params_test.go Dec 15, 2025
Copilot AI requested a review from yegor256 December 15, 2025 09:22
@yegor256 yegor256 marked this pull request as ready for review December 15, 2025 13:20
Copilot AI review requested due to automatic review settings December 15, 2025 13:20
@yegor256 yegor256 merged commit 1e628a1 into 138.a Dec 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves test organization by removing misplaced tests for a private function. The params_test.go file previously contained 7 test functions (TestMask_*) that were testing the private mask() function from refrax_client.go, which was inappropriate since test files should only test the public API of their corresponding source file.

Key changes:

  • Removed 7 test functions (TestMask_ReturnsEmptyForEmptyToken through TestMask_ShowsThreeCharacters) that tested the private mask() function
  • Retained all 14 TestNewMockParams_* tests that properly test the public NewMockParams() function from params.go

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 93 to 95
params := NewMockParams()
assert.Equal(t, "", params.Output, "output must be empty")
}
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While removing tests for the private mask() function from this file is correct (as it doesn't belong in params_test.go), the mask() function in refrax_client.go is now completely untested. The mask() function is used for security purposes to mask sensitive tokens in debug logs (line 328 of refrax_client.go). Consider adding tests for this function in refrax_client_test.go to ensure it properly masks tokens of various lengths, especially since it handles a security-sensitive operation.

Copilot uses AI. Check for mistakes.
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.

2 participants