Skip to content

Comparing browser versions fails when they have different numbers of components #56

@craigfowler

Description

@craigfowler

The following test would fail:

[Test, AutoMoqData]
public void AHigherVersionShouldBeGreaterThanALowerOneWithMoreComponents()
{
    var first = BrowserVersion.Create("95.0.4638.54");
    var second = BrowserVersion.Create("95.1");

    Assert.That(first, Is.LessThan(second), "First result is less than second result");
}

I think that this is because the first version number is treated as "dotted decimal" but the second as "semver". These two types can't be compared to one another, so the comparison fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions