[chore, spec] Version: test 8-character hash just in case (#7809)

Cf. https://github.com/koreader/koreader/issues/7805#issuecomment-855337115.
pull/7820/head
Frans de Jonge 3 years ago committed by GitHub
parent d8ea93662f
commit 27fa19c9c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save