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

moonbitlang / core / 6088
91%

Build:
DEFAULT BRANCH: main
Ran 15 Aug 2026 08:10AM 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:08AM UTC coverage: 90.714%. Remained the same
6088

push

github

bobzhang
test(encoding/utf8): add a spec-oracle QuickCheck suite

Pins `decode`, `decode_lossy`, and `encode` against an oracle
transcribed from the Unicode 16.0 core spec rather than from the
implementation: `lead_class` is Table 3-7 (the well-formed UTF-8 byte
sequences), `scan` is D93b (the maximal-subpart rule that fixes how
many U+FFFD a lossy decoder emits and where a strict decoder reports
the failure), and `push_scalar` is the closed-form encoder.

An independent oracle matters here because the package carries two
implementations selected by target -- a hand-written scanner
(decode_nonjs.mbt) and the platform TextDecoder/TextEncoder
(decode_js.mbt) -- and the scanner and encoder are additionally
`#intrinsic`, so a backend may substitute its own code generation for
the MoonBit body. The spec is the only thing all of them must agree
with.

Coverage is exhaustive where the input space allows -- every 1- and
2-byte string (settling every overlong lead, every out-of-range lead,
every bare continuation byte and every truncated 2-byte prefix), and
every 3- and 4-byte string over an alphabet containing all of Table
3-7's range boundaries. Elsewhere it is property-based, with a
generator biased toward near misses (boundary bytes, class-edge
scalars, truncated encodings) rather than uniform random bytes, which
would almost never form a valid multi-byte sequence and so would
exercise only the reject-immediately path.

Properties: oracle agreement for both decoders; encode/decode and
decode/encode round-trips (the latter pins injectivity, which an
accepted overlong form would break); decode_lossy output is always
itself well-formed; lossy agrees with strict wherever strict succeeds;
per-scalar byte lengths; concatenation homomorphism; BOM emission and
ignore_bom as inverses; the `Malformed` offset contract under
truncation; and view-offset independence.

All 13 tests pass on wasm, wasm-gc, js and native.

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

16011 of 17650 relevant lines covered (90.71%)

154740.82 hits per line

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