omega-rosetta
aien-dev/omega-rosetta
Brought by drakestapleton
omega-rosetta / exercises / pangram / test.om
| 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/pangram/canonical-data.json at |
| 47 | note commit 650bebeb39ad40439175288042aece982b0a90a9 (2026-10-19), MIT licence, |
| 48 | note https://github.com/exercism/problem-specifications |
| 49 | note 10 cases kept, 0 skipped, 1 superseded (reimplemented) cases omitted |
| 50 | text z0 "z" |
| 51 | text c1 "isPangram: empty sentence" |
| 52 | text s2 "abcdefghijklmnopqrstuvwxyz" |
| 53 | text c3 "isPangram: perfect lower case" |
| 54 | text s4 "the quick brown fox jumps over the lazy dog" |
| 55 | text c5 "isPangram: only lower case" |
| 56 | text s6 "a quick movement of the enemy will jeopardize five gunboats" |
| 57 | text c7 "isPangram: missing the letter 'x'" |
| 58 | text s8 "five boxing wizards jump quickly at it" |
| 59 | text c9 "isPangram: missing the letter 'h'" |
| 60 | text s10 "the_quick_brown_fox_jumps_over_the_lazy_dog" |
| 61 | text c11 "isPangram: with underscores" |
| 62 | text s12 "the 1 quick brown fox jumps over the 2 lazy dogs" |
| 63 | text c13 "isPangram: with numbers" |
| 64 | text s14 "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog" |
| 65 | text c15 "isPangram: missing letters replaced by numbers" |
| 66 | text s16 "\"Five quacking Zephyrs jolt my wax bed.\"" |
| 67 | text c17 "isPangram: mixed case and punctuation" |
| 68 | text s18 "abcdefghijklm ABCDEFGHIJKLM" |
| 69 | text c19 "isPangram: a-m and A-M are 26 different characters but not a pangram" |
| 70 | note canonical case 64f61791-508e-4f5c-83ab-05de042b0149 |
| 71 | fn tc0 to bool |
| 72 | ret eq ispangram part z0 0 0 false |
| 73 | end |
| 74 | note canonical case 74858f80-4a4d-478b-8a5e-c6477e4e4e84 |
| 75 | fn tc1 to bool |
| 76 | ret eq ispangram s2 true |
| 77 | end |
| 78 | note canonical case 61288860-35ca-4abe-ba08-f5df76ecbdcd |
| 79 | fn tc2 to bool |
| 80 | ret eq ispangram s4 true |
| 81 | end |
| 82 | note canonical case 6564267d-8ac5-4d29-baf2-e7d2e304a743 |
| 83 | fn tc3 to bool |
| 84 | ret eq ispangram s6 false |
| 85 | end |
| 86 | note canonical case c79af1be-d715-4cdb-a5f2-b2fa3e7e0de0 |
| 87 | fn tc4 to bool |
| 88 | ret eq ispangram s8 false |
| 89 | end |
| 90 | note canonical case d835ec38-bc8f-48e4-9e36-eb232427b1df |
| 91 | fn tc5 to bool |
| 92 | ret eq ispangram s10 true |
| 93 | end |
| 94 | note canonical case 8cc1e080-a178-4494-b4b3-06982c9be2a8 |
| 95 | fn tc6 to bool |
| 96 | ret eq ispangram s12 true |
| 97 | end |
| 98 | note canonical case bed96b1c-ff95-45b8-9731-fdbdcb6ede9a |
| 99 | fn tc7 to bool |
| 100 | ret eq ispangram s14 false |
| 101 | end |
| 102 | note canonical case 938bd5d8-ade5-40e2-a2d9-55a338a01030 |
| 103 | fn tc8 to bool |
| 104 | ret eq ispangram s16 true |
| 105 | end |
| 106 | note canonical case 7138e389-83e4-4c6e-8413-1e40a0076951 |
| 107 | fn tc9 to bool |
| 108 | ret eq ispangram s18 false |
| 109 | end |
| 110 | fn main to int |
| 111 | tcheck tc0 c1 |
| 112 | tcheck tc1 c3 |
| 113 | tcheck tc2 c5 |
| 114 | tcheck tc3 c7 |
| 115 | tcheck tc4 c9 |
| 116 | tcheck tc5 c11 |
| 117 | tcheck tc6 c13 |
| 118 | tcheck tc7 c15 |
| 119 | tcheck tc8 c17 |
| 120 | tcheck tc9 c19 |
| 121 | ret int get tfails 0 |
| 122 | end |