Update pdf-worker and update full-text test

Strip '\f' at end of extracted text and ignore '\n' in the middle of
text from the test PDF
This commit is contained in:
Dan Stillman 2023-04-29 04:56:28 -04:00
parent 26dade03f2
commit a497f501e9
2 changed files with 6 additions and 3 deletions

@ -1 +1 @@
Subproject commit 582f5d6cf91c5f09fc7898c3eced0ad32cbfccb1
Subproject commit 84e7814cf72f4234d2c0126aa0d7dbad712c196b

View file

@ -132,7 +132,9 @@ describe("Zotero.FullText", function () {
toSync.push({
item: pdfAttachment,
content: "Zotero [zoh-TAIR-oh] is a free, easy-to-use tool to help you collect, "
+ "organize, cite, and share your research sources.\n\n",
// pdf-worker handles whitespace differently than pdftotext
//+ "organize, cite, and share your research sources.\n\n",
+ "organize, cite, and share\nyour research sources.\n\n",
indexedChars: 0,
indexedPages: 1
});
@ -142,9 +144,10 @@ describe("Zotero.FullText", function () {
var data = yield Zotero.FullText.getUnsyncedContent(Zotero.Libraries.userLibraryID);
assert.lengthOf(data, 3);
let contents = toSync.map(x => x.content);
for (let d of data) {
assert.include(contents, d.content);
let pos = contents.indexOf(d.content);
assert.isAbove(pos, -1);
assert.equal(d.indexedChars, toSync[pos].indexedChars);
assert.equal(d.indexedPages, toSync[pos].indexedPages);
}