mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
* Swipe for menu and quickstart guide Because swiping for the menu is a big change from what we're used to, this commit includes a new quickstart guide. Fixes #2608. * add some dev docs * add FileConverter spec * add QuickStart spec * add Version module * add Version spec
29 lines
1.1 KiB
Lua
29 lines
1.1 KiB
Lua
describe("Version module", function()
|
|
local Version
|
|
setup(function()
|
|
require("commonrequire")
|
|
Version = require("version")
|
|
end)
|
|
it("should get current revision", function()
|
|
assert.is_true(22 >= (Version:getCurrentRevision()):len())
|
|
end)
|
|
it("should get normalized current version", function()
|
|
assert.is_true(9 >= tostring(Version:getNormalizedCurrentVersion()):len())
|
|
end)
|
|
it("should get normalized version", function()
|
|
local rev = "v2015.11-982-g704d4238"
|
|
local version, commit = Version:getNormalizedVersion(rev)
|
|
local expected_version = 201511982
|
|
local expected_commit = "704d4238"
|
|
assert.are.same(expected_version, version)
|
|
assert.are.same(expected_commit, commit)
|
|
end)
|
|
it("should fail gracefully", function()
|
|
local version, commit = Version:getNormalizedVersion()
|
|
local expected_version = nil
|
|
local expected_commit = nil
|
|
assert.are.same(expected_version, version)
|
|
assert.are.same(expected_commit, commit)
|
|
end)
|
|
end)
|