✓
Passing This code compiles and runs correctly.
Code
// Test: an unhandled `?!violated` traps — the insert site handles no
// panic branch, so auto-discharge synthesizes the @panic arm and the
// runtime echoes the payload (the column spelling) before the trap.
// The row is never committed; the store's contract stays loud.
//
// Expected: EXPECT_TRAP — stderr matches expected_patterns (the
// synthesized panic arm naming the event and the field).
import std/proto
import std/refine
import std/store
import std/io
std/proto:i64(Port)
std/proto(Server) {
port: Port
}
std/refine(Server) {
port: Port & >1024 & <=65535
}
std/store:new(fleet, capacity: 8) { web: Server }
std/store:insert(fleet) { web.port: 8080 }
std/store:insert(fleet) { web.port: 80 }
Actual
__store_insert_fleet: panic branch 'violated' fired — payload: web.port
thread 312427085 panic: __store_insert_fleet: unhandled panic branch 'violated' fired at runtime
???:?:?: 0x1001019bf in _output_emitted.main_module.flow1 (???)
???:?:?: 0x100101757 in _output_emitted.main (???)
???:?:?: 0x10010166b in _main (???)
???:?:?: 0x1816a3dff in ??? (???)
???:?:?: 0x0 in ??? (???)
Expected patterns
Each line is a regex that must match the program output.
__store_insert_fleet: panic branch 'violated' fired — payload: web.port
__store_insert_fleet: unhandled panic branch 'violated' fired at runtimeFlows
flow ~i64 click a branch to expand · @labels scroll to their anchor
i64 (expr: Port)
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Server, source: port: Port)
flow ~std/refine click a branch to expand · @labels scroll to their anchor
std/refine (Server, source: port: Port & >1024 & <=65535)
flow ~new click a branch to expand · @labels scroll to their anchor
new (fleet, capacity: 8, source: web: Server)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (fleet, source: web.port: 8080)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (fleet, source: web.port: 80)
Test Configuration
MUST_RUN