Mutation testing for MoonBit projects
Dependencies
moon install f4ah6o/turtles/cmd/turtles@<version>moon install https://github.com/f4ah6o/turtles.git cmd/turtles --branch mainmoon install https://github.com/f4ah6o/turtles.git cmd/turtles --tag v0.2.0moon install ./cmd/turtlesturtles --version # turtles 0.2.0
turtles --help
cd path/to/your-moonbit-module
turtles --dir . # or: turtles --list to preview the mutation setturtles --dir . # run all discovered mutants
turtles --dir . --list # preview mutations without running tests
turtles --dir . --file src/parser # only mutate paths containing TEXT
turtles --dir . --timeout 120 # per-command timeout in seconds (default 60)
turtles --dir . --json report.json # machine-readable report (schema 2)
turtles --dir . --iterate # reuse KILLED/UNVIABLE outcomes from the last run
turtles --dir . --affected # run only tests that can observe each mutant
turtles --dir . --timeout-multiplier 3 # per-phase timeout = 3x the measured baseline (min 10s)turtles --dir . --jobs 4turtles --dir . --fail-under 80score = killed / viable * 100 where viable = killed + survived + timeout{
"schema": 2,
"module": "/abs/path",
"turtles_version": "0.2.0",
"moon_version": "moon 0.1.20260920 (914d7da 2026-09-20) ~/.moon/bin/moon",
"baseline_duration_ms": "216",
"baseline_check_ms": "70",
"baseline_test_ms": "146",
"test_scope": "module",
"mutants": [
{ "id": "m-e7ccdf47c3b8bc0b", "path": "math.mbt", "line": 3, "column": 5,
"offset": 47, "end": 48, "group": "arithmetic",
"original": "+", "replacement": "-", "outcome": "KILLED",
"duration_ms": "202", "reused": false }
],
"summary": { "killed": 6, "survived": 0, "timeout": 0, "unviable": 0,
"reused": 0, "score": 100 }
}include = ["src/", "lib/"]
exclude = ["generated/", "vendor/"]
operators = ["comparison", "boolean", "arithmetic", "literal", "condition"]moon update
moon fmt --check
moon check --target native --deny-warn
moon test --target native
moon -C fixtures/basic test
moon run cmd/turtles -- --dir fixtures/basic --timeout 30Install
Download zipMutation testing for MoonBit projects
Dependencies