|
|
|
@ -24,6 +24,7 @@ describe("Readertoc module", function()
|
|
|
|
|
local ticks_level_0 = nil
|
|
|
|
|
it("should get ticks of level 0", function()
|
|
|
|
|
ticks_level_0 = toc:getTocTicks(0)
|
|
|
|
|
DEBUG("ticks", ticks_level_0)
|
|
|
|
|
assert.are.same(26, #ticks_level_0)
|
|
|
|
|
end)
|
|
|
|
|
local ticks_level_1 = nil
|
|
|
|
@ -53,8 +54,13 @@ describe("Readertoc module", function()
|
|
|
|
|
assert.are.same(190, toc:getPreviousChapter(200, 0))
|
|
|
|
|
end)
|
|
|
|
|
it("should get page left of chapter", function()
|
|
|
|
|
assert.are.same(15, toc:getChapterPagesLeft(10, 0))
|
|
|
|
|
assert.are.same(3, toc:getChapterPagesLeft(100, 0))
|
|
|
|
|
assert.are.same(14, toc:getChapterPagesLeft(10, 0))
|
|
|
|
|
assert.are.same(2, toc:getChapterPagesLeft(100, 0))
|
|
|
|
|
assert.are.same(nil, toc:getChapterPagesLeft(200, 0))
|
|
|
|
|
end)
|
|
|
|
|
it("should get page done of chapter", function()
|
|
|
|
|
assert.are.same(1, toc:getChapterPagesDone(10, 0))
|
|
|
|
|
assert.are.same(0, toc:getChapterPagesDone(100, 0))
|
|
|
|
|
assert.are.same(10, toc:getChapterPagesDone(200, 0))
|
|
|
|
|
end)
|
|
|
|
|
end)
|
|
|
|
|