From bccdecd24cc8e0a312a03d2485ab7ba64ce4937b Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Mon, 3 Apr 2023 16:36:45 -0400 Subject: [PATCH] Adding tests for cases around Issue 193 Signed-off-by: Matt Farina --- version_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/version_test.go b/version_test.go index ed82a53..767dc29 100644 --- a/version_test.go +++ b/version_test.go @@ -41,6 +41,10 @@ func TestStrictNewVersion(t *testing.T) { {"1.2.2147483648", false}, {"1.2147483648.3", false}, {"2147483648.3.0", false}, + + // The SemVer spec in a pre-release expects to allow [0-9A-Za-z-]. But, + // the lack of all 3 parts in this version should produce an error. + {"20221209-update-renovatejson-v4", true}, } for _, tc := range tests { @@ -94,6 +98,9 @@ func TestNewVersion(t *testing.T) { {"12.3.4.1234", true}, {"12.23.4.1234", true}, {"12.3.34.1234", true}, + + // The SemVer spec in a pre-release expects to allow [0-9A-Za-z-]. + {"20221209-update-renovatejson-v4", false}, } for _, tc := range tests {