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/omega-mv/blob/main/si/rosetta/exercises/rna-transcription/test.om # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / si / rosetta / exercises / rna-transcription / test.om` 122 lines ยท 2577 bytes Raw Blame History 1 note ---- test harness (appended after the solution by exercise.sh) ---- 2 text tok "ok " 3 text tnok "not ok " 4 text tsep " - " 5 text tnl "\n" 6 global tfails ulong 1 7 global tnum ulong 1 8 fn temit a view uchar * to void 9 o = ulong 0 10 while lt o len a bound 4096 11 k = write 1 a o sub len a o 12 if le k 0 13 exit 2 14 end 15 o = add o ulong k 16 end 17 end 18 fn temitu n ulong to void 19 d = new uchar 20 0 20 i = ulong 20 21 v = n 22 while true bound 20 23 i = sub i 1 24 put d i uchar add rem v 10 48 25 v = div v 10 26 if eq v 0 27 break 28 end 29 end 30 temit part d i sub 20 i 31 end 32 note one TAP-style line per case; main returns the number of failed cases 33 fn tcheck c bool what view uchar * to void 34 put tnum 0 add get tnum 0 1 35 if c 36 temit tok 37 else 38 temit tnok 39 put tfails 0 add get tfails 0 1 40 end 41 temitu get tnum 0 42 temit tsep 43 temit what 44 temit tnl 45 end 46 note cases: exercism/problem-specifications exercises/rna-transcription/canonical-data.json at 47 note commit `650bebeb39ad40439175288042aece982b0a90a9` (2026-10-19), MIT licence, 48 note https://github.com/exercism/problem-specifications 49 note 6 cases kept, 0 skipped 50 fn tbeq a view uchar * b view uchar * to bool 51 if ne len a len b 52 ret false 53 end 54 for i ulong len a 55 if ne get a i get b i 56 ret false 57 end 58 end 59 ret true 60 end 61 text z0 "z" 62 text c1 "toRna: Empty RNA sequence" 63 text s2 "C" 64 text e3 "G" 65 text c4 "toRna: RNA complement of cytosine is guanine" 66 text s5 "G" 67 text e6 "C" 68 text c7 "toRna: RNA complement of guanine is cytosine" 69 text s8 "T" 70 text e9 "A" 71 text c10 "toRna: RNA complement of thymine is adenine" 72 text s11 "A" 73 text e12 "U" 74 text c13 "toRna: RNA complement of adenine is uracil" 75 text s14 "ACGTGGTCTTAA" 76 text e15 "UGCACCAGAAUU" 77 text c16 "toRna: RNA complement" 78 note canonical case `b4631f82`-c98c-4a2f-90b3-`c5c2b6c6f661` 79 fn tc0 to bool 80 o = new uchar 1024 0 81 n = torna part z0 0 0 o 82 ret eq n 0 83 end 84 note canonical case `a9558a3c`-318c-4240-9256-`5d5ed47005a6` 85 fn tc1 to bool 86 o = new uchar 1024 0 87 n = torna s2 o 88 ret tbeq part o 0 n e3 89 end 90 note canonical case `6eedbb5c`-12cb-4c8b-9f51-`f8320b4dc2e7` 91 fn tc2 to bool 92 o = new uchar 1024 0 93 n = torna s5 o 94 ret tbeq part o 0 n e6 95 end 96 note canonical case `870bd3ec`-8487-471d-8d9a-`a25046488d3e` 97 fn tc3 to bool 98 o = new uchar 1024 0 99 n = torna s8 o 100 ret tbeq part o 0 n e9 101 end 102 note canonical case `aade8964`-02e1-4073-872f-`42d3ffd74c5f` 103 fn tc4 to bool 104 o = new uchar 1024 0 105 n = torna s11 o 106 ret tbeq part o 0 n e12 107 end 108 note canonical case `79ed2757`-f018-4f47-a1d7-`34a559392dbf` 109 fn tc5 to bool 110 o = new uchar 1024 0 111 n = torna s14 o 112 ret tbeq part o 0 n e15 113 end 114 fn main to int 115 tcheck tc0 c1 116 tcheck tc1 c4 117 tcheck tc2 c7 118 tcheck tc3 c10 119 tcheck tc4 c13 120 tcheck tc5 c16 121 ret int get tfails 0 122 end