✓
Passing Passing: the compiler rejects this program as expected.
Code
// std/diag/jsonl — importing the module IS the subscription: its lone
// `std/compiler(diagnostic)` join registers a jsonl consumer for every
// diagnostic the backend reports. The pin is the artifact, not the refusal.
import std/diag/jsonl
totally-bogus()
Supporting Files
{"code":"KORU040","file":"tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_055_diag_bus_jsonl_sink/input.k","line":6,"column":1,"message":"unknown tor 'input:totally-bogus'"}
Actual compiler output
error[KORU040]: unknown tor 'input:totally-bogus'
--> tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_055_diag_bus_jsonl_sink/input.k:6:1Error output must contain
error[KORU040]: unknown torFlows
flow ~totally-bogus click a branch to expand · @labels scroll to their anchor
totally-bogus
Test Configuration
MUST_ERROR
Post-validation Script:
#!/bin/bash
# The diagnostic crossed the barrier iff the sink fired: koru-diagnostics.jsonl exists
# with a KORU040 row carrying file/line — the refusal on stderr AND the row
# are the same ParseError seen through two consumers.
set -u
cd "$(dirname "$0")"
fail() { echo "FAIL: $1"; exit 1; }
[ -f koru-diagnostics.jsonl ] || fail "koru-diagnostics.jsonl not produced — sink did not fire"
lines=$(wc -l < koru-diagnostics.jsonl | tr -d ' ')
[ "$lines" -ge 1 ] || fail "koru-diagnostics.jsonl exists but has no rows"
grep -q '"code":"KORU040"' koru-diagnostics.jsonl || fail "KORU040 row missing from koru-diagnostics.jsonl"
grep -q '"file":' koru-diagnostics.jsonl || fail "diagnostic row missing file field"
grep -q '"line":' koru-diagnostics.jsonl || fail "diagnostic row missing line field"