Skip to content

TH_TNIN validation#90

Open
pycopath wants to merge 4 commits intomainfrom
15-detect-th_tnin
Open

TH_TNIN validation#90
pycopath wants to merge 4 commits intomainfrom
15-detect-th_tnin

Conversation

@pycopath
Copy link
Copy Markdown

Attempt in including TH_TNIN functionality with positive and negative test cases

Attempt in including TH_TNIN functionality with positive and negative test cases
@pycopath pycopath requested a review from SnosAlias February 19, 2026 04:27
@pycopath pycopath linked an issue Feb 19, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@claesmk claesmk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is generally a bad idea to use random numbers in a test case because that can cause random / unpredictable results.

It looks like your sample valid number was not valid. I think the correct check digit is 0 so 1101700203451 should have been 1101700203450

The checksum algorithm is pretty complicated. You would need to compute it if using random numbers. You can go down that path if you want, however, I'd suggest simplifying your test case to just one valid and invalid number so that you have a positive and negative test case to meet the requirement.

The test number I provided is already publicly exposed, however, you can come up with a way to obfuscate it if you want.

@pycopath
Copy link
Copy Markdown
Author

pycopath commented Feb 20, 2026 via email

Copy link
Copy Markdown
Contributor

@claesmk claesmk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@claesmk claesmk added the Team Z label Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect TH_TNIN

2 participants