diff --git a/spec/unit/version_spec.lua b/spec/unit/version_spec.lua index c114aa63f..8ef8266f3 100644 --- a/spec/unit/version_spec.lua +++ b/spec/unit/version_spec.lua @@ -6,16 +6,12 @@ describe("Version module", function() end) it("should get current revision", function() local rev = Version:getCurrentRevision() - local year, month, revision = rev:match("v(%d%d%d%d)%.(%d%d)-?(%d*)") - local commit = rev:match("-%d*-g(%x*)[%d_%-]*") + local year, month, point, revision = rev:match("v(%d%d%d%d)%.(%d%d).?(%d?)-?(%d*)") -- luacheck: ignore 211 + local commit = rev:match("-%d*-g(%x*)[%d_%-]*") -- luacheck: ignore 211 assert.is_truthy(year) assert.is_truthy(month) - assert.is_truthy(revision) - assert.is_truthy(commit) assert.is_true(4 == year:len()) assert.is_true(2 == month:len()) - assert.is_true(1 <= revision:len()) - assert.is_true(7 <= commit:len()) end) it("should get normalized current version", function() assert.is_true(10 == tostring(Version:getNormalizedCurrentVersion()):len())