Spec updates for new font

pull/1626/head
Frans de Jonge 9 years ago
parent d5066f85b4
commit 6eca0be44b

@ -14,7 +14,6 @@ env:
cache: cache:
directories: directories:
- $HOME/.ccache - $HOME/.ccache
# - base
addons: addons:
apt: apt:
@ -46,9 +45,9 @@ install:
- cp /etc/luarocks/config.lua $HOME/.luarocks/config.lua - cp /etc/luarocks/config.lua $HOME/.luarocks/config.lua
- echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua - echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua
- travis_retry luarocks --local install lua_cliargs - travis_retry luarocks --local install lua_cliargs
# versions older than 1.10ish and <2.0.rc10-0ish of busted may cause some weird segmentation faults - travis_retry luarocks --local install busted
- travis_retry git clone https://github.com/Olivine-Labs/busted/ #- travis_retry luarocks --local install busted 1.11.1-1
- cd busted && git checkout v2.0.rc10-0 && luarocks --local make busted-2.0.rc10-0.rockspec && cd .. #- mv -f $HOME/.luarocks/bin/busted_bootstrap $HOME/.luarocks/bin/busted
- travis_retry luarocks --local install luacov - travis_retry luarocks --local install luacov
# luasec doesn't automatically detect 64-bit libs # luasec doesn't automatically detect 64-bit libs
- travis_retry luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu - travis_retry luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu
@ -60,7 +59,7 @@ install:
script: script:
- travis_retry make fetchthirdparty all - travis_retry make fetchthirdparty all
- travis_retry make testfront - make testfront
after_success: after_success:
- make coverage - make coverage

@ -55,11 +55,11 @@ describe("EPUB document module", function()
end) end)
it("should register droid sans fallback", function() it("should register droid sans fallback", function()
local fonts_registry = { local fonts_registry = {
"Droid Sans Fallback",
"Droid Sans Mono", "Droid Sans Mono",
"FreeSans", "FreeSans",
"FreeSerif", "FreeSerif",
"Noto Sans", "Noto Sans",
"Noto Sans CJK SC",
"Noto Serif", "Noto Serif",
} }
local face_list = cre.getFontFaces() local face_list = cre.getFontFaces()

@ -67,7 +67,7 @@ describe("Readersearch module", function()
local words = search:searchFromEnd("Verona") local words = search:searchFromEnd("Verona")
assert.truthy(words) assert.truthy(words)
local pageno = doc:getPageFromXPointer(words[1].start) local pageno = doc:getPageFromXPointer(words[1].start)
assert.are.equal(190, pageno) assert.are.equal(199, pageno)
end end
for i = 230, 235, 1 do for i = 230, 235, 1 do
rolling:gotoPage(i) rolling:gotoPage(i)
@ -87,7 +87,7 @@ describe("Readersearch module", function()
doc:gotoXPointer(words[1].start) doc:gotoXPointer(words[1].start)
words = search:searchNext("Verona", 0) words = search:searchNext("Verona", 0)
end end
assert.are.equal(14, count) assert.are.equal(13, count)
end) end)
end) end)
describe("search API for PDF documents", function() describe("search API for PDF documents", function()

@ -16,10 +16,10 @@ describe("Readertoc module", function()
end) end)
it("should get toc title from page", function() it("should get toc title from page", function()
local title = toc:getTocTitleByPage(51) local title = toc:getTocTitleByPage(51)
--DEBUG("toc", toc.toc) DEBUG("toc", toc.toc)
assert(title == "Prologue") assert(title == "SCENE V. A hall in Capulet's house.")
local title = toc:getTocTitleByPage(155) local title = toc:getTocTitleByPage(155)
assert(title == "SCENE IV. Hall in Capulet's house.") assert(title == "SCENE I. Friar Laurence's cell.")
end) end)
describe("getTocTicks API", function() describe("getTocTicks API", function()
local ticks_level_0 = nil local ticks_level_0 = nil
@ -50,24 +50,24 @@ describe("Readertoc module", function()
end) end)
end) end)
it("should get page of next chapter", function() it("should get page of next chapter", function()
assert.are.same(23, toc:getNextChapter(10, 0)) assert.are.same(24, toc:getNextChapter(10, 0))
assert.are.same(106, toc:getNextChapter(100, 0)) assert.are.same(113, toc:getNextChapter(100, 0))
assert.are.same(nil, toc:getNextChapter(200, 0)) assert.are.same(nil, toc:getNextChapter(200, 0))
end) end)
it("should get page of previous chapter", function() it("should get page of previous chapter", function()
assert.are.same(8, toc:getPreviousChapter(10, 0)) assert.are.same(8, toc:getPreviousChapter(10, 0))
assert.are.same(94, toc:getPreviousChapter(100, 0)) assert.are.same(97, toc:getPreviousChapter(100, 0))
assert.are.same(174, toc:getPreviousChapter(200, 0)) assert.are.same(182, toc:getPreviousChapter(200, 0))
end) end)
it("should get page left of chapter", function() it("should get page left of chapter", function()
assert.are.same(12, toc:getChapterPagesLeft(10, 0)) assert.are.same(13, toc:getChapterPagesLeft(10, 0))
assert.are.same(5, toc:getChapterPagesLeft(100, 0)) assert.are.same(12, toc:getChapterPagesLeft(100, 0))
assert.are.same(nil, toc:getChapterPagesLeft(200, 0)) assert.are.same(nil, toc:getChapterPagesLeft(200, 0))
end) end)
it("should get page done of chapter", function() it("should get page done of chapter", function()
assert.are.same(2, toc:getChapterPagesDone(10, 0)) assert.are.same(2, toc:getChapterPagesDone(10, 0))
assert.are.same(6, toc:getChapterPagesDone(100, 0)) assert.are.same(0, toc:getChapterPagesDone(100, 0))
assert.are.same(26, toc:getChapterPagesDone(200, 0)) assert.are.same(18, toc:getChapterPagesDone(200, 0))
end) end)
describe("collasible TOC", function() describe("collasible TOC", function()
it("should collapse the secondary toc nodes by default", function() it("should collapse the secondary toc nodes by default", function()

Loading…
Cancel
Save