Skip to content

test: clarify error messages in isMethodAllowed tests - #42

Open
Krishnanand-G wants to merge 1 commit into
go-chi:masterfrom
Krishnanand-G:fix/test-error-messages-28
Open

Krishnanand-G wants to merge 1 commit into
go-chi:masterfrom
Krishnanand-G:fix/test-error-messages-28

Conversation

@Krishnanand-G

@Krishnanand-G Krishnanand-G commented Jun 29, 2026 •

Copy link
Copy Markdown

Summary

Closes #28.

TestDefault already uses the corrected must not be nil messages on master. This PR fixes the remaining misleading failure messages in the same file:

  • TestIsMethodAllowedReturnsFalseWithNoMethods: the test sets allowedMethods to an empty slice, not nil
  • TestIsMethodAllowedReturnsTrueWithOptions: describes the actual assertion (OPTIONS allowed with default options)

Test plan

  • go test ./...
  • go vet ./...

@Krishnanand-G
Krishnanand-G force-pushed the fix/test-error-messages-28 branch 2 times, most recently from b5442f6 to 37c2d28 Compare June 29, 2026 06:23
@Krishnanand-G
Krishnanand-G force-pushed the fix/test-error-messages-28 branch from 37c2d28 to 39eaac6 Compare June 29, 2026 06:24
@Krishnanand-G

Copy link
Copy Markdown
Author

Thanks for the approval @VojtechVitek. Happy to squash/rebase if needed — could this be merged when you have a minute?

@Krishnanand-G

Copy link
Copy Markdown
Author

@pkieltyka this got an approval from @VojtechVitek a while back. Mind merging when you get a sec? Happy to squash if needed.

@Krishnanand-G

Copy link
Copy Markdown
Author

This is approved but blocked on CI. The 1.22.x macos-latest job failed on a runner issue (dyld: missing LC_UUID load command), which triggered fail-fast and cancelled the other macOS/Windows jobs. Ubuntu passed on all versions, and the failure isn't related to this change. Could someone with admin rights re-run the failed jobs?

@Krishnanand-G

Krishnanand-G commented Sep 1, 2026 •

Copy link
Copy Markdown
Author

I tried to rerun the failed jobs, but GitHub requires repository admin rights to do that. The previous failures were runner errors rather than test failures, and the PR is already approved. Could a maintainer rerun the workflow when convenient?

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.

Fixed error messages in TestDefault

2 participants