interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / exercises / pangram / test.om

122 lines · 3240 bytes Raw Blame History
1note ---- test harness (appended after the solution by exercise.sh) ----
2text tok "ok "
3text tnok "not ok "
4text tsep " - "
5text tnl "\n"
6global tfails ulong 1
7global tnum ulong 1
8fn temit a view uchar * to void
9o = ulong 0
10while lt o len a bound 4096
11k = write 1 a o sub len a o
12if le k 0
13exit 2
14end
15o = add o ulong k
16end
17end
18fn temitu n ulong to void
19d = new uchar 20 0
20i = ulong 20
21v = n
22while true bound 20
23i = sub i 1
24put d i uchar add rem v 10 48
25v = div v 10
26if eq v 0
27break
28end
29end
30temit part d i sub 20 i
31end
32note one TAP-style line per case; main returns the number of failed cases
33fn tcheck c bool what view uchar * to void
34put tnum 0 add get tnum 0 1
35if c
36temit tok
37else
38temit tnok
39put tfails 0 add get tfails 0 1
40end
41temitu get tnum 0
42temit tsep
43temit what
44temit tnl
45end
46note cases: exercism/problem-specifications exercises/pangram/canonical-data.json at
47note commit 650bebeb39ad40439175288042aece982b0a90a9 (2026-10-19), MIT licence,
48note https://github.com/exercism/problem-specifications
49note 10 cases kept, 0 skipped, 1 superseded (reimplemented) cases omitted
50text z0 "z"
51text c1 "isPangram: empty sentence"
52text s2 "abcdefghijklmnopqrstuvwxyz"
53text c3 "isPangram: perfect lower case"
54text s4 "the quick brown fox jumps over the lazy dog"
55text c5 "isPangram: only lower case"
56text s6 "a quick movement of the enemy will jeopardize five gunboats"
57text c7 "isPangram: missing the letter 'x'"
58text s8 "five boxing wizards jump quickly at it"
59text c9 "isPangram: missing the letter 'h'"
60text s10 "the_quick_brown_fox_jumps_over_the_lazy_dog"
61text c11 "isPangram: with underscores"
62text s12 "the 1 quick brown fox jumps over the 2 lazy dogs"
63text c13 "isPangram: with numbers"
64text s14 "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog"
65text c15 "isPangram: missing letters replaced by numbers"
66text s16 "\"Five quacking Zephyrs jolt my wax bed.\""
67text c17 "isPangram: mixed case and punctuation"
68text s18 "abcdefghijklm ABCDEFGHIJKLM"
69text c19 "isPangram: a-m and A-M are 26 different characters but not a pangram"
70note canonical case 64f61791-508e-4f5c-83ab-05de042b0149
71fn tc0 to bool
72ret eq ispangram part z0 0 0 false
73end
74note canonical case 74858f80-4a4d-478b-8a5e-c6477e4e4e84
75fn tc1 to bool
76ret eq ispangram s2 true
77end
78note canonical case 61288860-35ca-4abe-ba08-f5df76ecbdcd
79fn tc2 to bool
80ret eq ispangram s4 true
81end
82note canonical case 6564267d-8ac5-4d29-baf2-e7d2e304a743
83fn tc3 to bool
84ret eq ispangram s6 false
85end
86note canonical case c79af1be-d715-4cdb-a5f2-b2fa3e7e0de0
87fn tc4 to bool
88ret eq ispangram s8 false
89end
90note canonical case d835ec38-bc8f-48e4-9e36-eb232427b1df
91fn tc5 to bool
92ret eq ispangram s10 true
93end
94note canonical case 8cc1e080-a178-4494-b4b3-06982c9be2a8
95fn tc6 to bool
96ret eq ispangram s12 true
97end
98note canonical case bed96b1c-ff95-45b8-9731-fdbdcb6ede9a
99fn tc7 to bool
100ret eq ispangram s14 false
101end
102note canonical case 938bd5d8-ade5-40e2-a2d9-55a338a01030
103fn tc8 to bool
104ret eq ispangram s16 true
105end
106note canonical case 7138e389-83e4-4c6e-8413-1e40a0076951
107fn tc9 to bool
108ret eq ispangram s18 false
109end
110fn main to int
111tcheck tc0 c1
112tcheck tc1 c3
113tcheck tc2 c5
114tcheck tc3 c7
115tcheck tc4 c9
116tcheck tc5 c11
117tcheck tc6 c13
118tcheck tc7 c15
119tcheck tc8 c17
120tcheck tc9 c19
121ret int get tfails 0
122end