Skip to content

tests: remove dead code and add a test case#71

Merged
stropitek merged 1 commit intomainfrom
parse-document-number-optional
Mar 9, 2026
Merged

tests: remove dead code and add a test case#71
stropitek merged 1 commit intomainfrom
parse-document-number-optional

Conversation

@stropitek
Copy link
Contributor

@stropitek stropitek commented Mar 7, 2026

It seemed like untested code was trying to read a secondary optional part when the document number was already spreading to the optional part.

However, the code could not work because the condition on the check digit being < was not done on the check digit but another longer range of characters.

I haven't found anywhere that the case is even possible in an authentic document, so I removed it.

The test case added is similar to another example, but I liked that it comes from PRADO so I added it anyway. It already passed before the change.

@stropitek stropitek requested a review from targos March 7, 2026 12:03
@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.21%. Comparing base (f716198) to head (dd6da8f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #71      +/-   ##
==========================================
+ Coverage   88.66%   89.21%   +0.54%     
==========================================
  Files          48       48              
  Lines         450      445       -5     
  Branches      123      121       -2     
==========================================
- Hits          399      397       -2     
+ Misses         51       48       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stropitek stropitek merged commit 151c505 into main Mar 9, 2026
11 checks passed
@stropitek stropitek deleted the parse-document-number-optional branch March 9, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants