-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test the Vehicle VIN validator with known good and bad values, fixes … #2640
Conversation
The only broken test here is fixed in #2638 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @alextaujenis thanks for the PR! I left some comments.
…efactor deterministic tests
I removed the standalone (duplicate) vin regex test, which is checked inside the I think this PR is good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for improving the password tests, too. thank you @alextaujenis 💯
Summary
An issue could occur where both the Vehicle VIN generator and validator are refactored in this library (for instance, changing the modulus operator from 11 to 10). This would change both the checksum generator and validator, allowing the test suite to pass, but fundamentally changing (and corrupting) the VIN checksum algorithm.
To protect against this, as well as giving confidence to anyone refactoring the Vehicle VIN generator or validator, several known good and bad VIN checks have been added as tests.