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

moonbitlang / core / 4210
95%

Build:
DEFAULT BRANCH: main
Ran 06 May 2026 12:48AM UTC
Jobs 1
Files 364
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

06 May 2026 12:47AM UTC coverage: 94.614% (-0.001%) from 94.615%
4210

push

github

bobzhang
refactor: build to_json result without mutation; lean on check-mode coercion

Apply the comprehension-based build pattern across more ToJson impls,
mirroring the recently-merged Map/SortedMap collapses (#3522 / #3546).
Per maintainer feedback: rely on check-mode coercion — no need to wrap
in `Json::array(...)` when returning `Json`, no need to call
`x.to_json()` inside the comprehension when `X : ToJson` is in scope
(see existing `immut/vector/vector.mbt:669` for the canonical form).

- hashmap/json.mbt — `HashMap::to_json`:
  collapse mutating-Map-build to `Json::object(Map(capacity=..., [for k, v in self => (...)]))`
  (Map shape kept; check-mode unwrap is for arrays only).
- hashset/hashset.mbt — `HashSet::to_json`:
  collapse to bare `[for entry in self.entries if entry is Some({key, ..}) => key]`.
- priority_queue/priority_queue.mbt — drop `Json::array(...)` wrap and inner `to_json()`.
- immut/sorted_set/immutable_set.mbt — same.
- immut/priority_queue/types.mbt — same.
- priority_queue/moon.pkg — move `moonbitlang/core/json` to the test-only
  import block (only README.mbt.md doctest needs `@json.json_inspect`
  now that the impl no longer mentions `Json::`).

Style: labeled args before positional (`capacity=...`).

Semantics-preserving: full `moon test` (6425/6425) passes and
`moon info` produces no `.mbti` change.

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

7 of 7 new or added lines in 6 files covered. (100.0%)

14825 of 15669 relevant lines covered (94.61%)

219000.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 4210.1 06 May 2026 12:48AM UTC 365
94.62
GitHub Action Run
Source Files on build 4210
  • Tree
  • List 364
  • Changed 6
  • Source Changed 6
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 18a74cec on github
  • Prev Build on main (#4207)
  • Next Build on main (#4216)
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