From 6eca0be44bc914cde5f9ba66bdbb2c1f813a4348 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Sat, 5 Sep 2015 11:32:34 +0200 Subject: [PATCH] Spec updates for new font --- .travis.yml | 9 ++++----- spec/unit/document_spec.lua | 2 +- spec/unit/readersearch_spec.lua | 4 ++-- spec/unit/readertoc_spec.lua | 22 +++++++++++----------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b8cba56c..86e299bd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,6 @@ env: cache: directories: - $HOME/.ccache -# - base addons: apt: @@ -46,9 +45,9 @@ install: - cp /etc/luarocks/config.lua $HOME/.luarocks/config.lua - echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua - 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 git clone https://github.com/Olivine-Labs/busted/ - - cd busted && git checkout v2.0.rc10-0 && luarocks --local make busted-2.0.rc10-0.rockspec && cd .. + - travis_retry luarocks --local install busted + #- travis_retry luarocks --local install busted 1.11.1-1 + #- mv -f $HOME/.luarocks/bin/busted_bootstrap $HOME/.luarocks/bin/busted - travis_retry luarocks --local install luacov # luasec doesn't automatically detect 64-bit libs - travis_retry luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu @@ -60,7 +59,7 @@ install: script: - travis_retry make fetchthirdparty all - - travis_retry make testfront + - make testfront after_success: - make coverage diff --git a/spec/unit/document_spec.lua b/spec/unit/document_spec.lua index 0500ada69..68e99a8e5 100644 --- a/spec/unit/document_spec.lua +++ b/spec/unit/document_spec.lua @@ -55,11 +55,11 @@ describe("EPUB document module", function() end) it("should register droid sans fallback", function() local fonts_registry = { - "Droid Sans Fallback", "Droid Sans Mono", "FreeSans", "FreeSerif", "Noto Sans", + "Noto Sans CJK SC", "Noto Serif", } local face_list = cre.getFontFaces() diff --git a/spec/unit/readersearch_spec.lua b/spec/unit/readersearch_spec.lua index cd618a024..4c5c5886c 100644 --- a/spec/unit/readersearch_spec.lua +++ b/spec/unit/readersearch_spec.lua @@ -67,7 +67,7 @@ describe("Readersearch module", function() local words = search:searchFromEnd("Verona") assert.truthy(words) local pageno = doc:getPageFromXPointer(words[1].start) - assert.are.equal(190, pageno) + assert.are.equal(199, pageno) end for i = 230, 235, 1 do rolling:gotoPage(i) @@ -87,7 +87,7 @@ describe("Readersearch module", function() doc:gotoXPointer(words[1].start) words = search:searchNext("Verona", 0) end - assert.are.equal(14, count) + assert.are.equal(13, count) end) end) describe("search API for PDF documents", function() diff --git a/spec/unit/readertoc_spec.lua b/spec/unit/readertoc_spec.lua index 3c111ea4a..b1a27e2db 100644 --- a/spec/unit/readertoc_spec.lua +++ b/spec/unit/readertoc_spec.lua @@ -16,10 +16,10 @@ describe("Readertoc module", function() end) it("should get toc title from page", function() local title = toc:getTocTitleByPage(51) - --DEBUG("toc", toc.toc) - assert(title == "Prologue") + DEBUG("toc", toc.toc) + assert(title == "SCENE V. A hall in Capulet's house.") local title = toc:getTocTitleByPage(155) - assert(title == "SCENE IV. Hall in Capulet's house.") + assert(title == "SCENE I. Friar Laurence's cell.") end) describe("getTocTicks API", function() local ticks_level_0 = nil @@ -50,24 +50,24 @@ describe("Readertoc module", function() end) end) it("should get page of next chapter", function() - assert.are.same(23, toc:getNextChapter(10, 0)) - assert.are.same(106, toc:getNextChapter(100, 0)) + assert.are.same(24, toc:getNextChapter(10, 0)) + assert.are.same(113, toc:getNextChapter(100, 0)) assert.are.same(nil, toc:getNextChapter(200, 0)) end) it("should get page of previous chapter", function() assert.are.same(8, toc:getPreviousChapter(10, 0)) - assert.are.same(94, toc:getPreviousChapter(100, 0)) - assert.are.same(174, toc:getPreviousChapter(200, 0)) + assert.are.same(97, toc:getPreviousChapter(100, 0)) + assert.are.same(182, toc:getPreviousChapter(200, 0)) end) it("should get page left of chapter", function() - assert.are.same(12, toc:getChapterPagesLeft(10, 0)) - assert.are.same(5, toc:getChapterPagesLeft(100, 0)) + assert.are.same(13, toc:getChapterPagesLeft(10, 0)) + assert.are.same(12, toc:getChapterPagesLeft(100, 0)) assert.are.same(nil, toc:getChapterPagesLeft(200, 0)) end) it("should get page done of chapter", function() assert.are.same(2, toc:getChapterPagesDone(10, 0)) - assert.are.same(6, toc:getChapterPagesDone(100, 0)) - assert.are.same(26, toc:getChapterPagesDone(200, 0)) + assert.are.same(0, toc:getChapterPagesDone(100, 0)) + assert.are.same(18, toc:getChapterPagesDone(200, 0)) end) describe("collasible TOC", function() it("should collapse the secondary toc nodes by default", function()