Skip to content

test(sem_ver): add gherkin test coverage for edge cases from flagd#1873 #20

@aepfli

Description

@aepfli

Background

flagd#1873 documents several sem_ver parsing and comparison edge cases that differ across SDK implementations. The flagd-evaluator already implements the correct behavior, but there is no gherkin test coverage in the shared testbed for these scenarios.

Missing Test Coverage

1. v/V-prefixed versions

The evaluator strips the prefix before parsing, but this is not tested in the testbed.

{"sem_ver": [{"var": "version"}, ">=", "v2.0.0"]}

Expected: same result as 2.0.0 (prefix stripped transparently).

2. Partial versions

The evaluator accepts 1.21.2.0 and 11.0.0, but this is not tested.

3. Build metadata ignored (SemVer 2.0.0 Rule 10)

1.0.0+build1 = 1.0.0+build2 should be true (build metadata must not affect precedence). Not currently tested.

4. Parse failure returns null

An invalid version string or unknown operator should return null (triggering default variant fallback), not false. Not tested in testbed.

What Needs to Be Done

  1. Add flag definitions to the testbed for these scenarios
  2. Add @semver-edge-cases gherkin scenarios to targeting.feature
  3. Add those scenarios to the evaluator's tests/gherkin_tests.rs

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions