Skip to content

Review PR #93: Expand IBAN test coverage#94

Merged
strider2038 merged 1 commit into
cursor/-bc-e62609c4-def9-4060-92ba-c9980b5fd54d-526ffrom
cursor/pr-93-ff5a
Apr 5, 2026
Merged

Review PR #93: Expand IBAN test coverage#94
strider2038 merged 1 commit into
cursor/-bc-e62609c4-def9-4060-92ba-c9980b5fd54d-526ffrom
cursor/pr-93-ff5a

Conversation

@strider2038
Copy link
Copy Markdown
Contributor

Summary

Code review of PR #93 (Add IBAN validation constraint) with expanded test coverage for validate.IBAN.

Tests added

  • Territory alias codes: AX (Åland→FI), GG/JE/IM (Crown deps→GB), GF (French territory→FR) — these IBANs always fail because the regex pattern uses the parent country prefix, matching Symfony behavior.
  • Check digit boundaries: 00, 02, 98 — ensures the full range [00..01] and [99] reject, and [02..98] reach mod-97.
  • Mixed whitespace: multiple NBSP, multiple NNBSP, mixed space types in one value.
  • Short inputs: 1, 2, 3 character strings.
  • Additional invalid chars: newline, \xe2 alone.
  • Leading/trailing spaces: should be stripped and still validate.
  • Mixed-case with BBAN letters: lowercase IT and GB IBANs.

Coverage

validate/iban.go functions remain at 100% on all reachable paths. Two internal helpers (isAlpha2 66.7%, ibanExpandedNumeric/ibanMod97 ~90%) have unreachable defensive branches due to prior validation steps — this is expected and correct.

See the review comment on PR #93 for the full analysis.

Open in Web Open in Cursor 

… digits, mixed whitespace

Co-authored-by: Igor Lazarev <strider2038@yandex.ru>
@strider2038 strider2038 marked this pull request as ready for review April 5, 2026 05:13
@strider2038 strider2038 merged commit 82a0e6f into cursor/-bc-e62609c4-def9-4060-92ba-c9980b5fd54d-526f Apr 5, 2026
strider2038 added a commit that referenced this pull request Apr 5, 2026
* Add IBAN validation (it, validate, is, translations)

- validate.IBAN with mod-97 check and Symfony 7.2 country patterns
- it.IsIBAN, is.IBAN, ErrInvalidIBAN, EN/RU messages
- Tests and examples; changelog entry

Co-authored-by: Igor Lazarev <strider2038@yandex.ru>

* Expand IBAN unit tests (edge cases and more countries)

- Named subtests; valid samples for BE, AT, IT, SE
- Canonicalization: only spaces/NBSP, too short, bad UTF-8 prefixes
- Reject: non-alpha country, non-numeric check digits, BBAN vs pattern, tab

Co-authored-by: Igor Lazarev <strider2038@yandex.ru>

* test(validate): extend IBAN cases for BR, MU, SC patterns

- Valid samples exercising Symfony regex branches (trailing letters, long BBAN)
- Negative: BR with correct length/pattern but failing mod-97; SC wrong total length; MU bank code width

Co-authored-by: Igor Lazarev <strider2038@yandex.ru>

* test(validate): expand IBAN coverage with territory aliases, boundary digits, mixed whitespace (#94)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
@strider2038 strider2038 deleted the cursor/pr-93-ff5a branch April 6, 2026 17:55
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