• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gladiaio / num2words2 / 35657799232
97%

Build:
DEFAULT BRANCH: main
Ran 21 Sep 2026 09:36PM UTC
Jobs 6
Files 169
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Sep 2026 09:32PM UTC coverage: 95.172% (+0.006%) from 95.166%
35657799232

push

github

web-flow
fix(ar,hi): reject negative and fractional ordinals (#144)

Ports savoirfairelinux/num2words#672 by @santhreal.

Num2Word_AR.to_ordinal never called verify_ordinal, so a negative
indexed arabicOrdinal backwards and returned a silently wrong word
instead of raising: to_ordinal(-1) was 'ihda' (the feminine one) and
to_ordinal(-100) was 'mi'a' (hundred). It also did number = int(number)
up front, so a fractional value was truncated and read as an ordinal.

Num2Word_HI.to_ordinal_num maps the value character by character through
a Devanagari digit table, so a negative died on the sign with
KeyError "'-'" and a fractional value on the point with KeyError "'.'".

Both now run verify_ordinal first and raise TypeError, matching every
other language. Hindi word ordinals still accept negatives -
to_ordinal(-1) is unchanged - which is what upstream's own test for #672
asserts.

Inf and NaN keep their existing OverflowError and ValueError: Base
writes 'if not int(value) == value', and it is the int() call itself
that raises for those, before any comparison.

Adds regression tests to tests/lang/test_ar.py and tests/lang/test_hi.py
mirroring the upstream ones, and updates the two in-file Rust tests that
pinned the old truncating behaviour.

Adds CHANGELOG.md to carry credit for upstream ports, and points
MANIFEST.in at it (it referenced a CHANGES.rst that does not exist).

Co-authored-by: Jean-Louis Queguiner <jean-louis.queguiner@gmail.com>

1266 of 1422 branches covered (89.03%)

Branch coverage included in aggregate %.

31 of 31 new or added lines in 2 files covered. (100.0%)

24637 of 25795 relevant lines covered (95.51%)

5.73 hits per line

Jobs
ID Job ID Ran Files Coverage
1 3.10 - 35657799232.1 21 Sep 2026 09:42PM UTC 169
95.17
GitHub Action Run
2 3.11 - 35657799232.2 21 Sep 2026 09:42PM UTC 169
95.17
GitHub Action Run
3 3.15 - 35657799232.3 21 Sep 2026 09:42PM UTC 169
95.17
GitHub Action Run
4 3.14 - 35657799232.4 21 Sep 2026 09:42PM UTC 169
95.17
GitHub Action Run
5 3.12 - 35657799232.5 21 Sep 2026 09:42PM UTC 169
95.17
GitHub Action Run
6 3.13 - 35657799232.6 21 Sep 2026 09:42PM UTC 169
95.17
GitHub Action Run
Source Files on build 35657799232
  • Tree
  • List 169
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • de87b48c on github
  • Prev Build on main (#35656860992)
  • Next Build on main (#35658729994)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc