ludic/tools/x
Orkuncakilkaya ea2c6ab246
All checks were successful
bootstrap / cfree-fixpoint (push) Successful in 17s
ci / build-and-test (push) Successful in 1m13s
commit-lint / conventional-commits (push) Successful in 4s
docs / build-and-deploy (push) Successful in 19s
feat(testing): built-in test blocks + expect assertions, auto-run with pass/fail (#12)
A `test "name" { ... }` top-level block is discovered automatically and run by a
synthetic runner @main — no `entry` to write, nothing to register. Inside a test,
expect(cond) / expect_eq(a, b) / expect_near(a, b, tol) assert; on failure they
print `file:line: <what> failed (got G, want W)` and set a per-test fail flag but
keep going, so one run reports every failure. The runner prints `ok   - name` /
`FAIL - name` per test, a `== N passed, M failed ==` summary, and exits non-zero
if any test failed — so `ludic spec_test.ludic` drops straight into bin/x and CI.
expect_near carries the tolerance fixed-point / accumulated-integer game math need.

Frontend: new `test` keyword (parse_test -> N_TEST, collected in g_tests) and the
call node now carries its source line for the file:line messages. Backend:
emit_test_runner synthesises @fn__test_i bodies + the runner @main; the expect*
builtins lower to a branch-print-flag tail (emit_expect_fail). g_src_name (set in
main from the input path) supplies the filename. The compiler's own source has no
`test` blocks, so its self-compiled IR is unchanged and the C-free fixpoint holds.

- `test` wired into the vocabulary (ludic_syntax.h, JetBrains lexer, TextMate
  grammar) and documented (docs/language/testing/)
- examples/library/testing.ludic: a passing spec, guarded by a new spec_case in
  the regression suite (build, run, require exit 0 + the expected summary)

Coverage instrumentation (the biggest lift in #12) is left as a follow-up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-31 14:27:45 +03:00
..
build.ludic chore(repo): DX cleanup — categorise examples, text-diffable golden, build/ output (#27 #28 #30) 2026-08-30 18:54:21 +03:00
checks.ludic feat(tooling): port the doc/lint/grammar checks to Ludic (no Python) 2026-08-31 01:06:38 +03:00
docgen.ludic feat(tooling): port the docgen site generator to Ludic (no Python) (#41) 2026-08-31 02:12:32 +03:00
docgen_check.ludic feat(tooling): port the docgen site generator to Ludic (no Python) (#41) 2026-08-31 02:12:32 +03:00
docgen_gen.ludic feat(tooling): port the docgen site generator to Ludic (no Python) (#41) 2026-08-31 02:12:32 +03:00
json.ludic feat(tooling): port the doc/lint/grammar checks to Ludic (no Python) 2026-08-31 01:06:38 +03:00
main.ludic feat(tooling): port the docgen site generator to Ludic (no Python) (#41) 2026-08-31 02:12:32 +03:00
prelude.ludic ci: add build + test + bootstrap-cfree workflows for the Forgejo runner 2026-08-30 23:23:23 +03:00
release.ludic feat(release): SemVer + ludicc --version, changesets, and x release 2026-08-30 23:46:59 +03:00
selfhost.ludic feat(stdlib): add Anim.* + Tween.* — deterministic 2D animation & tweening (#5) 2026-08-31 13:05:06 +03:00
selfhost_test.ludic ci: add build + test + bootstrap-cfree workflows for the Forgejo runner 2026-08-30 23:23:23 +03:00
test.ludic feat(testing): built-in test blocks + expect assertions, auto-run with pass/fail (#12) 2026-08-31 14:27:45 +03:00
tools.ludic feat(lang): new Type { field: value } record initialisers 2026-08-31 01:20:06 +03:00