-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lib] Add some unit tests for
invertObjectToMap<K, V>(obj: { [K]: V })
Summary: Generated some basic unit tests for `invertObjectToMap` via GitHub Copilot. One of the generated tests failed and surfaced possiblity that object entries could be "lost" if there were duplicate values... which is very often a possiblity. Added `invariant` to ensure values are unique and no entries are lost. Should be O(1) check so not worried about overhead. Test Plan: Unit tests pass, made sure we had a test for `BigInt` values. Reviewers: ashoat, ginsu, tomek, rohan Reviewed By: ashoat Subscribers: wyilio Differential Revision: https://phab.comm.dev/D9677
- Loading branch information
1 parent
7483cae
commit 0eb7a82
Showing
2 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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