Skip to content

Commit

Permalink
test: add positive and negative cases for testing new match
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
  • Loading branch information
spiffcs committed Apr 17, 2024
1 parent d6c3fe0 commit aa5bdb4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions grype/version/golang_constraint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ func TestGolangConstraints(t *testing.T) {
constraint: "",
satisfied: true,
},
{
name: "pseudo version from package should not be considered as satisfied against semver constraint",
version: "v0.0.0-0.20210101000000-abcdef123456",
constraint: "<v1.0.0",
satisfied: false,
},
// https://github.com/anchore/grype/pull/1797
{
name: "pseudo version from package should be considered as satisfied against pseudo version constraint",
version: "0.0.0-20230131185645-0ae4915a9391",
constraint: "< 0.0.0-20240131185645-0ae4915a9391",
satisfied: true,
},
}

for _, tc := range tests {
Expand Down

0 comments on commit aa5bdb4

Please sign in to comment.