From 27fa19c9c4978e28bc837ee2e298892ea7009df9 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Sun, 6 Jun 2021 18:15:52 +0200 Subject: [PATCH] [chore, spec] Version: test 8-character hash just in case (#7809) Cf. https://github.com/koreader/koreader/issues/7805#issuecomment-855337115. --- spec/unit/version_spec.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/unit/version_spec.lua b/spec/unit/version_spec.lua index a96531056..21ef7827a 100644 --- a/spec/unit/version_spec.lua +++ b/spec/unit/version_spec.lua @@ -17,7 +17,7 @@ describe("Version module", function() it("should get current version", function() assert.is_true(12 == tostring(Version:getNormalizedCurrentVersion()):len()) end) - it("should get version", function() + it("should get version with 7-character hash", function() local rev = "v2015.11-982-g704d4238" local version, commit = Version:getNormalizedVersion(rev) local expected_version = 201511000982 @@ -25,6 +25,14 @@ describe("Version module", function() assert.are.same(expected_version, version) assert.are.same(expected_commit, commit) end) + it("should get version with 8-character hash", function() + local rev = "v2021.05-70-gae544b74" + local version, commit = Version:getNormalizedVersion(rev) + local expected_version = 202105000070 + local expected_commit = "ae544b74" + assert.are.same(expected_version, version) + assert.are.same(expected_commit, commit) + end) it("should get version with four number revision", function() local rev = "v2015.11-1755-gecd7b5b_2018-07-02" local version, commit = Version:getNormalizedVersion(rev)