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

moonbitlang / core / 6090
91%

Build:
DEFAULT BRANCH: main
Ran 15 Aug 2026 08:11AM UTC
Jobs 1
Files 437
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

15 Aug 2026 08:10AM UTC coverage: 90.714%. Remained the same
6090

push

github

bobzhang
test(range): specify iter against an exact-arithmetic oracle

`@range.iter`'s specification is "from, from + step, from + 2 * step,
... while the value is on the correct side of `to`", and the whole
difficulty is in the words the implementation has to add to make that
terminate on a fixed-width type: it stops as soon as `current + step`
fails to make progress past `current`.

The oracle here computes the sequence in exact, unbounded arithmetic
(BigInt) and stops when the next value would leave the type's range.
That is a genuinely independent statement of the same rule -- for a
two's-complement type, "the exact next value is outside [min, max]" and
"the wrapped next value fails to make progress" are the same condition,
but the oracle never performs the wrapping arithmetic whose corner
cases are under test. A reference written with the same fixed-width `+`
would reproduce an overflow bug rather than catch it.

Cases are generated in BigInt space and then narrowed to each Step
type, so all eight integral impls -- Int, Int64, UInt, UInt64, Int16,
UInt16, Byte and BigInt itself -- are checked against the one oracle.
Generation concentrates where the overflow stop actually engages: `from`
is drawn from the ends of the type's range and their neighbours, `to`
is either a near neighbour or another anchor, and `step` is small, or
scaled so a few hundred additions cross the range, or an anchor (which
is how step = MIN_VALUE and a bare step = 1 across a full-width range
get covered). Both sides are capped at 300 values so an unbounded case
degrades to a prefix comparison rather than a hang.

Three oracle-free properties restate the contract directly: the values
form an arithmetic progression, strictly monotonic and never past `to`;
an inclusive range is the exclusive one plus at most its endpoint; and
negating the step retraces the same values in reverse.

Float and Double cannot use the exact oracle -- repeated addition is
not `from + k * step` -- so they are s... (continued)

16011 of 17650 relevant lines covered (90.71%)

156222.62 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6090.1 15 Aug 2026 08:11AM UTC 438
90.73
GitHub Action Run
Source Files on build 6090
  • Tree
  • List 437
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 2b2169f8 on github
  • Prev Build on main (#6088)
  • Next Build on main (#6091)
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