1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-24 09:08:07 +02:00

Merge pull request #19324 from nicolo-ribaudo/search-dash-date

Allow searching for number-number on two lines
This commit is contained in:
Jonas Jenwald 2025-01-15 15:04:09 +01:00 committed by GitHub
commit 711bf2bd12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 78 additions and 30 deletions

View file

@ -1104,6 +1104,40 @@ describe("pdf_find_controller", function () {
});
});
it("performs a search with a dash between two digits", async () => {
const { eventBus, pdfFindController } = await initPdfFindController();
await testSearch({
eventBus,
pdfFindController,
state: {
query: "2008-02",
},
matchesPerPage: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
selectedMatch: {
pageIndex: 13,
matchIndex: 0,
},
pageMatches: [[], [], [], [], [], [], [], [], [], [], [], [], [], [314]],
pageMatchesLength: [
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[7],
],
});
});
describe("custom matcher", () => {
it("calls to the matcher with the right arguments", async () => {
const QUERY = "Foo bar";