nx_moonraker_client_test.nx
buildroot/runtime/nx_moonraker_client_test.nx
about
nx_moonraker_client_test.nx -- verify URL building + JSON body +
HTTP request assembly + status parsing against known-byte expected
outputs.
Closed-form invariants (every byte hand-verified):
(a) Filename validation: "test.gcode" safe; quotes/backslash refused.
(b) URL build: base "http://10.0.0.5:7125" + path "/printer/info"
-> "http://10.0.0.5:7125/printer/info" (33 bytes).
(c) JSON print-start body for "voron.gcode" ->
(28 bytes including the {} and quotes).
(d) POST request bytes start with "POST /printer/print/start HTTP/1.1\r\n"
contain "Host: 10.0.0.5:7125\r\n",
contain "Content-Type: application/json\r\n",
contain "Content-Length: 28\r\n\r\n", and end with the JSON body.
(e) GET request bytes start with "GET /printer/info HTTP/1.1\r\n".
(f) GET request with API key contains "X-Api-Key: secret\r\n".
(g) Status-line parser: "HTTP/1.1 200 OK\r\n" -> 200.
(h) Status-line parser: "HTTP/1.1 503 Service" -> 503.
(i) Status-line parser malformed: "HTTPx/1.1 200 OK" -> -1.
expect_exit: 0
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_moonraker_client.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
| 31 | func smoke_buf_eq(buf: *u8, expected: *u8, n: i64) -> i64 called by 1: main |
| 40 | func smoke_contains(buf: *u8, len: i64, needle: *u8) -> i64 called by 1: main |
| 58 | func cstr_len(s: *u8) -> i64 |
| 64 | func main() -> i64 |