test(isTaxID): cover dk-DK century digits 5-8 years 37-58 - #2851
Closed
arronKler wants to merge 1 commit into
Closed
test(isTaxID): cover dk-DK century digits 5-8 years 37-58#2851arronKler wants to merge 1 commit into
arronKler wants to merge 1 commit into
Conversation
validatorjs#2819 already maps century digits 5-8 as years 00-57 → 2000s and 58-99 → 1800s, but the suite never asserted those years. Add the checksum-valid CPR examples from validatorjs#2818 so the old 37-58 rejection cannot return unnoticed. Fixes validatorjs#2818
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2851 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2599 2599
Branches 658 658
=========================================
Hits 2599 2599 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2819 already corrected
dkDkCheckso century digits 5-8 map years 00-57 to the 2000s and 58-99 to the 1800s (Danish CPR table: https://da.wikipedia.org/wiki/CPR-nummer, also https://blog.ploeh.dk/2018/12/10/danish-cpr-numbers-in-f/). The algorithm change did not add tests for the old 37-58 rejection gap, so #2818 stayed open.This adds the checksum-valid examples from that issue (
0101375005,0101455009,0101575004,0101585018, plus the 36/59 boundaries) to the existingisTaxIDdk-DKcases.Fixes #2818
Checklist