fix(tests): populate Set in idGenerator tests (#266)#304
Merged
ilteoood merged 2 commits intofastify:mainfrom Oct 24, 2025
Merged
fix(tests): populate Set in idGenerator tests (#266)#304ilteoood merged 2 commits intofastify:mainfrom
ilteoood merged 2 commits intofastify:mainfrom
Conversation
Eomm
reviewed
Jun 1, 2025
gurgunday
approved these changes
Jun 1, 2025
Uzlopak
approved these changes
Jun 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add calls to
ids.add(id)inside the loop in bothidGeneratortests so that theSetis actually populated and the test detects real collisions.Why
Without this line, the
Setremains empty andids.has(id)never returnstrue, making the test pass even if the generator produces duplicate IDs. With this change, we ensure the test only passes if there are truly no collisions.Closes #266
Checklist
npm run testandnpm run benchmark