Skip to content

Add test cementing memoization of falsey return values - #117

Open
freekmurze wants to merge 1 commit into
mainfrom
test/cement-falsey-memoization
Open

freekmurze wants to merge 1 commit into
mainfrom
test/cement-falsey-memoization

Conversation

@freekmurze

Copy link
Copy Markdown
Member

Adds a data-driven test asserting that once() memoizes falsey return values (null, false, 0, 0.0, '', '0', []): the value is returned as-is and the callback runs exactly once.

This locks in the current behaviour so a truthiness-based cache check (as proposed in #116) can't regress it unnoticed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant