nx_websocket_frame_test.nx
buildroot/runtime/nx_websocket_frame_test.nx
about
nx_websocket_frame_test.nx -- KAT for nx_websocket_frame.
Audits the existing 255-LOC frame codec. The module shipped with
inline main() assertions but no formal test + smoke wrapper, so
any latent bug would be silent (same class as the nx_sort_insertion
canonical-without-KAT bug closed 2026-05-20). This test promotes
the ad-hoc main() invariants to a regression gate AND adds the
RFC 6455 §5.7-style canonical wire vectors that prove
browser-compatibility.
Test vectors (RFC 6455 §5.7):
T1 Single-frame unmasked text "Hello": 0x81 0x05 H e l l o
T2 Single-frame masked client text "Hello" with key 0x37FA213D
T3 Single binary unmasked with payload_len 126 (extended 16-bit)
T4 Single binary unmasked with payload_len 65536 (extended 64-bit)
T5 Ping/pong/close opcodes round-trip through parse+build
T6 Self-inverse mask XOR (mask twice = identity)
expect_exit: 0
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_websocket_frame.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 25 | func main() -> i64 |