code wiki / (root) / prop_lex_number_test.nx

prop_lex_number_test.nx

buildroot/runtime/prop_lex_number_test.nx

2734 B86 linesdepth 4pulls 10 transitivereach 0 importersview sourcekind gate/prooftopic prop
docsdependenciesstructsconstsfunctions

about

prop_lex_number_test.nx -- property test for lex_source on numbers. Property: for every random decimal digit sequence D with value V, lex_source(D) produces exactly one TK_INT with int_val == V. Catches: * Overflow in the digit accumulator (V doesn't match hand math) * Off-by-one in digit iteration * Mis-tokenising legal digit chars as something else * Crash on edge cases (leading zeros, max i64 magnitude, etc.) Runs 2000 iterations. Each iteration picks a random number of digits (1..18 -- safely under i64 range for uniform digits).

dependencies 5 imports · 0 importers

syscalls.nx types.nx lex_kinds.nx lex.nx prop_test.nx prop_lex_number_test.nx

imports: syscalls.nxtypes.nxlex_kinds.nxlex.nxprop_test.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

23func ascii_to_i64(buf: *u8, n: i64) -> i64 {
33func main() -> i64 {