Write tests for this function. Include edge cases I probably didn't think of.
Code:
```{{language}}
{{paste function}}
```
Test framework: {{Jest / Vitest / pytest / etc.}}
Output:
1. **Happy-path tests** (3-5) — normal usage
2. **Boundary tests** — empty input, max input, min input, edge of valid range
3. **Failure modes** — invalid inputs, malformed data, dependencies missing
4. **Sneaky cases** — things that look like edge cases but are actually correct behavior worth pinning down
5. **What I should test but can't easily here** — flag anything that needs integration tests, not unit tests
For each test, one-line comment explaining what scenario it pins down.testingedge casesunit tests