Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cortex/blob/main/tests/json/t_uni.om # cortex aien-dev/cortex Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `cortex / tests / json / t_uni.om` 76 lines ยท 1179 bytes Raw Blame History 1 note tests/json/t_uni.om - differential harness for uni_rust.om (+ js_dbg_str): input records come in 2 note (haystack, needle) pairs; output per pair: [lower][trim "start len"][Debug][contains 0/1], each 3 note u32-framed inside one record. Needs t_io.om. 4 global thay uchar `1048576` 5 fn t_beg to ulong 6 p = get jobl 0 7 for k ulong 4 8 js_byte 0 9 end 10 ret p 11 end 12 fn t_end p ulong to void 13 n = sub sub get jobl 0 p 4 14 put job p uchar and n 255 15 put job add p 1 uchar and shr n 8 255 16 put job add p 2 uchar and shr n 16 255 17 put job add p 3 uchar and shr n 24 255 18 end 19 fn main to int 20 num_init 21 for it ulong `100000000` 22 if not t_rec 23 t_flush 24 ret 0 25 end 26 n = get jinl 0 27 for i ulong n 28 x = get jin i 29 put thay i x 30 end 31 if not t_rec 32 trap 9 33 end 34 m = get jinl 0 35 for i ulong m 36 x = get jin i 37 put jrq i x 38 end 39 put jrql 0 m 40 ru_prep 41 for i ulong n 42 x = get thay i 43 put jrs i x 44 put jsp i x 45 end 46 put jrsl 0 n 47 c = ru_contains 48 put jobl 0 0 49 p = t_beg 50 for i ulong get jrll 0 51 js_byte get jrl i 52 end 53 t_end p 54 p = t_beg 55 ru_trim 0 n 56 js_u64 get jtro 0 57 js_byte 32 58 js_u64 get jtrl 0 59 t_end p 60 p = t_beg 61 put jnv 0 0 62 put jnl 0 uint n 63 put jnk 0 6 64 js_dbg_str 0 65 t_end p 66 p = t_beg 67 if c 68 js_byte 49 69 else 70 js_byte 48 71 end 72 t_end p 73 t_emitjob 74 end 75 ret 1 76 end