Skip to content

range issue perhaps? #42

Open
Open
@twoofy

Description

@twoofy

I was trying to figure out what might be causing some unexpected behavior in this package. To be honest, I'm not sure if this is something I'm doing wrong or not.

I added some extra code to range_test.go, which I think shows the issue:

		{">1.2.2 <1.2.4", []tv{
			{"1.2.1", false},
			{"1.2.1-pl1", false},
			{"1.2.2", false},
			{"1.2.2-pl1", false},
			{"1.2.3", true},
			{"1.2.3-pl1", true},
			{"1.2.4", false},
			{"1.2.4-pl1", false},
		}},
		{">=1.2.2 <1.2.4", []tv{
			{"1.2.1", false},
			{"1.2.1-pl1", false},
			{"1.2.2", true},
			{"1.2.2-pl1", true},
			{"1.2.3", true},
			{"1.2.3-pl1", true},
			{"1.2.4", false},
			{"1.2.4-pl1", false},
		}},

The issue is that versions with -pl1 seem to return different results then those without.

The output of the above is:

--- FAIL: TestParseRange (0.00s)
	range_test.go:514: Invalid for case ">1.2.2 <1.2.4" matching "1.2.4-pl1": Expected false, got: true
	range_test.go:514: Invalid for case ">=1.2.2 <1.2.4" matching "1.2.2-pl1": Expected true, got: false
	range_test.go:514: Invalid for case ">=1.2.2 <1.2.4" matching "1.2.4-pl1": Expected false, got: true
FAIL
exit status 1
FAIL	github.com/blang/semver	0.007s

Am I doing something wrong here?

  • Greg

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