Skip to content

chore: cover comparator normalization - #917

Merged
reggi merged 1 commit into
mainfrom
reggi/chore-adds-tests
Oct 20, 2026
Merged

reggi merged 1 commit into
mainfrom
reggi/chore-adds-tests

Conversation

@reggi

@reggi reggi commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add regression fixtures and integration coverage for comparator whitespace, equality boundaries, and malformed loose alternatives.
  • Cover long prerelease identifiers, build-metadata normalization, and existing version limits across strict/loose and prerelease options.
  • Tests only; no production behavior changes.

Stack

First of two stacked PRs; followed by #918. Contains only commit 1eda6b4. Merge this PR before the performance implementation.

Validation

Full npm test (including coverage, ESLint, and template checks) passes on the combined stack.

@reggi
reggi requested a review from a team as a code owner October 8, 2026 15:07
@reggi reggi changed the title chore: cover comparator normalization regressions chore: cover comparator normalization Oct 8, 2026
nkolev92
nkolev92 previously approved these changes Oct 8, 2026
Comment thread test/fixtures/range-parse.js Outdated
['< 2.0.0', '<2.0.0'],
['<\t2.0.0', '<2.0.0'],
['1.2.3-dev = 1.2.3-dev', '1.2.3-dev'],
['1.2.3-dev= 1', null, { loose: true }],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I was reviewing this to learn about some of the oddities of the parsing, and I see the loose version, but then I see 1.2.3-dev= 1 on line 96.

We should consider better ordering.

['<\t2.0.0', '<2.0.0'],
['1.2.3-dev = 1.2.3-dev', '1.2.3-dev'],
['1.2.3-dev= 1', null, { loose: true }],
['<\u00a02.0.0', '<2.0.0'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I imagine these are just non-breaking space, but worth combining/commenting on them.

Comment thread test/fixtures/range-parse.js Outdated
['<\ufeff2.0.0', '<2.0.0'],
['1.2.3 = 1.2.3', '1.2.3'],
['== 1', null],
['>v= 1.2.3', '1.2.3', { loose: true }],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non loose version?

reggi added a commit that referenced this pull request Oct 13, 2026
Follow-up to #917, targeting `reggi/chore-adds-tests` so these tests can
be merged into that PR independently of the performance fix.

## Changes
- Materialize the operator/precision fixtures as explicit
default-options rows, retaining the original fixture cases.
- Run every base row with default options, `loose`, `includePrerelease`,
and both, using explicit expected-result overrides (1,392 fixtures
total).
- Preserve prerelease options when comparing canonical ranges and assert
that all four option combinations cover the same input list.

Only `test/fixtures/range-parse.js` and `test/classes/range.js` are
changed.

## Validation
- `npm test` passed, including coverage checks, repository-wide lint,
and `template-oss-check`.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e40646ba-5ae5-433c-abed-2cdf7f08793f
Expand the four-mode range fixture matrix and align regression tests with the v5 and v6 backports.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 03b4a44c-26a3-4d56-9b26-cd46006844c6
@reggi
reggi merged commit 7257c14 into main Oct 20, 2026
35 checks passed
@reggi
reggi deleted the reggi/chore-adds-tests branch October 20, 2026 17:07
reggi added a commit that referenced this pull request Oct 20, 2026
## Summary
Backport the v7 range parsing coverage from #917 to v5. Add coverage for
comparator whitespace normalization, range parsing options, equality
boundaries, malformed loose alternatives, long identifiers, and build
metadata.

Use the same range fixture inputs and options as v7 while preserving
v5-specific expected results. Tests only; no production code or
dependency changes.

## Stack
First of two stacked v5 backport PRs, based on `release/v5`. Contains
test commit `8bbf475`. The follow-up backport of the v7 performance fix
in #918 targets this branch. Merge this PR before the v5 fix.

The follow-up v5 fix is #927.

## Validation
The full v5 test suite passed locally on Node 20.19.5 with 100%
statement, branch, function, and line coverage; one test was skipped.
The full supported Node-version matrix remains unverified locally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 03b4a44c-26a3-4d56-9b26-cd46006844c6
reggi added a commit that referenced this pull request Oct 20, 2026
## Summary
Backport the v7 range parsing coverage from #917 to v6. Add coverage for
comparator whitespace normalization, range parsing options, equality
boundaries, malformed loose alternatives, long identifiers, and build
metadata.

Use the same range fixture inputs and options as v7 while preserving
v6-specific expected results. Tests only; no production code or
dependency changes.

## Stack
First of two stacked v6 backport PRs, based on `release/v6`. Contains
test commit `b381d7f`. The follow-up backport of the v7 performance fix
in #918 targets this branch. Merge this PR before the v6 fix.

The follow-up v6 fix is #925.

## Validation
The full v6 test suite passed locally on Node 20.19.5 with 100%
statement, branch, function, and line coverage; one test was skipped.
The full supported Node-version matrix remains unverified locally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 03b4a44c-26a3-4d56-9b26-cd46006844c6
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.

4 participants