Bump apparentlymart/go-versions to 1.0.2 to fix NOT prerelease constraint issue. (#1859)

Signed-off-by: Tony Yin <chang.yu.yin@fmr.com>
This commit is contained in:
Tony Yin 2024-07-25 18:07:23 +08:00 committed by GitHub
parent 47da4f5789
commit cccd8c85b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 3 deletions

2
go.mod
View File

@ -15,7 +15,7 @@ require (
github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0
github.com/apparentlymart/go-shquot v0.0.1
github.com/apparentlymart/go-userdirs v0.0.0-20200915174352-b0c018a67c13
github.com/apparentlymart/go-versions v1.0.1
github.com/apparentlymart/go-versions v1.0.2
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2
github.com/aws/aws-sdk-go-v2 v1.23.2
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.6

4
go.sum
View File

@ -287,8 +287,8 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
github.com/apparentlymart/go-userdirs v0.0.0-20200915174352-b0c018a67c13 h1:JtuelWqyixKApmXm3qghhZ7O96P6NKpyrlSIe8Rwnhw=
github.com/apparentlymart/go-userdirs v0.0.0-20200915174352-b0c018a67c13/go.mod h1:7kfpUbyCdGJ9fDRCp3fopPQi5+cKNHgTE4ZuNrO71Cw=
github.com/apparentlymart/go-versions v1.0.1 h1:ECIpSn0adcYNsBfSRwdDdz9fWlL+S/6EUd9+irwkBgU=
github.com/apparentlymart/go-versions v1.0.1/go.mod h1:YF5j7IQtrOAOnsGkniupEA5bfCjzd7i14yu0shZavyM=
github.com/apparentlymart/go-versions v1.0.2 h1:n5Gg9YvSLK8Zzpy743J7abh2jt7z7ammOQ0oTd/5oA4=
github.com/apparentlymart/go-versions v1.0.2/go.mod h1:YF5j7IQtrOAOnsGkniupEA5bfCjzd7i14yu0shZavyM=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=

View File

@ -144,3 +144,33 @@ func TestParsePlatform(t *testing.T) {
}
}
}
func TestMeetingConstraints(t *testing.T) {
tests := []struct {
constraintStr string
versionStr string
expected bool
}{
// NOT PreRelease Version. This failed in apparentlymart/go-versions 1.0.1, and fixed in 1.0.2
{"!= 2.0.0-beta1, 2.0.0-beta1", "2.0.0-beta1", false},
}
for _, test := range tests {
vc, err := ParseVersionConstraints(test.constraintStr)
if err != nil {
t.Fatalf("ParseVersionConstraints failed: %v", err)
}
version, err := ParseVersion(test.versionStr)
if err != nil {
t.Fatalf("ParseVersion failed: %v", err)
}
versionSet := MeetingConstraints(vc)
result := versionSet.Has(version)
if result != test.expected {
t.Errorf("For constraint %s and version %s, expected %t, got %t", test.constraintStr, test.versionStr, test.expected, result)
}
}
}