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

moonbitlang / core / 4096
94%

Build:
DEFAULT BRANCH: main
Ran 30 Apr 2026 07:59AM UTC
Jobs 1
Files 363
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

30 Apr 2026 07:57AM UTC coverage: 94.593% (-0.02%) from 94.61%
4096

push

github

bobzhang
fix(string): abort on negative repeat count and guard against overflow

`String::repeat` and `StringView::repeat` previously matched
`_..=0 => ""`, silently returning an empty string for any non-positive
`n`. Negative `n` is almost always a caller bug (sign error /
off-by-one), so abort with `"negative repeat count"` instead. An `n` of
`0` still returns the empty string.

Also mirror the multiplicative-overflow guard already present in
`Bytes::repeat` so a wrap-around in `len * n` aborts cleanly with
`"repeat result too large"` instead of silently producing a wrong-sized
size hint.

Two existing tests that asserted the old silent-empty behavior on
negative `n` are converted to `panic` tests.

Refs #3498. Split out from #3505 for easier review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

5 of 8 new or added lines in 1 file covered. (62.5%)

14834 of 15682 relevant lines covered (94.59%)

218815.95 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
98.45
-0.92% builtin/string_methods.mbt
Jobs
ID Job ID Ran Files Coverage
1 4096.1 30 Apr 2026 07:59AM UTC 364
94.6
GitHub Action Run
Source Files on build 4096
  • Tree
  • List 363
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 557f0478 on github
  • Prev Build on main (#4094)
  • Next Build on main (#4098)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc