Skip to content

Not equal expression with wildcards !=1.0.x checks failure #80

Open
@ByteF1sh

Description

@ByteF1sh

hi, i want to exclude all the versions in 1.1.x and set a range like this "!=1.1.x",but all the versions are checked failure.
Here's the test code.

import (
	"github.com/blang/semver/v4"
	"testing"
)

func TestV(t *testing.T) {
	versionRange := "!=1.0.x"
	expectedRange, err := semver.ParseRange(versionRange)
	if err != nil { //wrong range exp
		t.Fail()
	}
	v, _ := semver.Parse("1.1.1")
	if !expectedRange(v) { // expectedRange(v) == false,want true but got false
		t.Fail()
	}
}

I noticed that this range will expand to <1.1.0 and >=1.2.0 ,and it should link with OR but not AND .
Is there any plan to fix it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions