code wiki / (root) / nx_assert_fire_test.nx

nx_assert_fire_test.nx source

↩ module page · 14 lines · 457 B

1// nx_assert_fire_test.nx -- exercises the FAIL path of nx_assert. 2// 3// Invokes an intentional failure so CI scripts can verify that 4// exit-code 200 actually propagates. Paired with nx_assert.nx's 5// self-test which covers the success path. 6 7import "syscalls.nx" 8import "nx_assert.nx" 9 10func main() -> i64 { 11 nx_assert_ptr(0 as *u8, "intentional-null" as *u8) 12 // unreachable: nx_assert_ptr exits 200 before we get here 13 return 0 14}