Comfy-Org / Comfy-Org/ComfyUI_frontend
Add extensive unit test coverage for curveUtils math/geometry functions
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Background
The `curveUtils.ts` module contains pure functions performing complex math and geometry calculations:
- `createMonotoneInterpolator`: monotone cubic Hermite interpolation
- `histogramToPath`: SVG path generation from histogram data
- `curvesToLUT`: lookup table generation from curve points
Currently, basic test coverage exists in `curveUtils.test.ts`, but as a manually-coded math/geometry engine, we need significantly more extensive coverage.
## Objective
Expand the test suite to cover:
- All edge cases for each function
- The many permutations of inputs and boundary conditions
- Deterministic assertions for all calculated results
- Numerical stability and precision edge cases
- Invalid/extreme input handling
Since these are pure functions with deterministic outputs, they are ideal candidates for comprehensive testing.
## Context
Requested by: @christian-byrne
Related PR: #8860
Comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8860#discussion_r2838847344
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-9112-Add-extensive-unit-test-coverage-for-curveUtils-math-geometry-functions-3106d73d3650816887bbf92f8c0650e2) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.