fix(install): semver mistaking . as the beginning of pre/build tags (#11577)

This commit is contained in:
Dylan Conway
2024-06-03 16:50:21 -07:00
committed by GitHub
parent 8806bf9c4e
commit f56e6c7d54
2 changed files with 6 additions and 1 deletions

View File

@@ -1199,7 +1199,8 @@ pub const Version = extern struct {
}
if (i < input.len and switch (input[i]) {
'.' => true,
// `.` is expected only if there are remaining core version numbers
'.' => part_i != 3,
else => false,
}) {
i += 1;

View File

@@ -6421,6 +6421,10 @@ const prereleaseFailTests = [
title: "greater than or equal to highest prerelease + 1",
depVersion: ">=5.0.0-alpha.154",
},
{
title: "`.` instead of `-` should fail",
depVersion: "5.0.0.alpha.150",
},
],
// prereleases-4 has one version
// - 2.0.0-pre.0