smalot / smalot/pdfparser

RawDataParser->getXrefData not fully covered by tests

Open
#436 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs more info unit tests / CI
Dominant language
PHP
Stars
2.7k
Forks
579
Avg merge
2m
Merged PRs (30d)
1

Description

I had an Exception throw by RawDataParser->getXrefData, I didn't debug this case yet, but I noticed that there's an elseif not covered by tests...
I left a var_dump inside the elseif and I ran phpunit and this var_dump didn't show on terminal (I left a var_dump outside this elseif after just to be sure that would be shown on terminal)

This elseif is not covered (RawDataParser.php:822)

 elseif ($startxrefPreg) {
            // startxref found
            $startxref = $matches[1][0];
        }

PS: I will try to debug it later, I am just opening an issue for the record

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with RawDataParser.php around line 822 and inspect the existing PHPUnit coverage for RawDataParser->getXrefData. Reproduce the reported exception and determine the input that reaches the uncovered elseif. Done means the case has a regression test and the relevant PHPUnit tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.