-
Notifications
You must be signed in to change notification settings - Fork 2
/
callsign-generate-test.rkt
479 lines (463 loc) · 18.6 KB
/
callsign-generate-test.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
#lang racket
(require rackunit "callsign-generate.rkt")
; digit?
(check-false (digit? #\A))
(check-false (digit? #\B))
(check-false (digit? #\C))
(check-false (digit? #\D))
(check-false (digit? #\E))
(check-false (digit? #\F))
(check-false (digit? #\G))
(check-false (digit? #\H))
(check-false (digit? #\I))
(check-false (digit? #\J))
(check-false (digit? #\K))
(check-false (digit? #\L))
(check-false (digit? #\M))
(check-false (digit? #\N))
(check-false (digit? #\O))
(check-false (digit? #\P))
(check-false (digit? #\Q))
(check-false (digit? #\R))
(check-false (digit? #\S))
(check-false (digit? #\T))
(check-false (digit? #\U))
(check-false (digit? #\V))
(check-false (digit? #\W))
(check-false (digit? #\X))
(check-false (digit? #\Y))
(check-false (digit? #\Z))
(check-false (digit? #\a))
(check-false (digit? #\b))
(check-false (digit? #\c))
(check-false (digit? #\d))
(check-false (digit? #\e))
(check-false (digit? #\f))
(check-false (digit? #\g))
(check-false (digit? #\h))
(check-false (digit? #\i))
(check-false (digit? #\j))
(check-false (digit? #\k))
(check-false (digit? #\l))
(check-false (digit? #\m))
(check-false (digit? #\n))
(check-false (digit? #\o))
(check-false (digit? #\p))
(check-false (digit? #\q))
(check-false (digit? #\r))
(check-false (digit? #\s))
(check-false (digit? #\t))
(check-false (digit? #\u))
(check-false (digit? #\v))
(check-false (digit? #\w))
(check-false (digit? #\x))
(check-false (digit? #\y))
(check-false (digit? #\z))
(check-true (digit? #\0))
(check-true (digit? #\1))
(check-true (digit? #\2))
(check-true (digit? #\3))
(check-true (digit? #\4))
(check-true (digit? #\5))
(check-true (digit? #\6))
(check-true (digit? #\7))
(check-true (digit? #\8))
(check-true (digit? #\9))
(check-false (digit? #\!))
(check-false (digit? #\#))
(check-false (digit? #\@))
(check-false (digit? #\_))
(check-false (digit? 'BT#))
(check-false (digit? 'SK@))
(check-false (digit? 'AR!))
(check-false (digit? '(#\A #\B #\C)))
(check-false (digit? '(#\1 #\2 #\3)))
(check-false (digit? '(1 2 3)))
(check-false (digit? '(A B C)))
(check-false (digit? '(A (B C))))
(check-false (digit? '()))
; digits-from
(check-equal? (digits-from '(#\A #\B #\C #\1 #\2 #\3)) '(#\1 #\2 #\3))
(check-equal? (digits-from '(#\A #\1 #\B #\2 #\C #\3)) '(#\1 #\2 #\3))
(check-equal? (digits-from '(A #\A #\9 Q #\B #\8 #\C M #\4)) '(#\9 #\8 #\4))
(check-equal? (digits-from '()) '())
(check-equal? (digits-from '(#\A #\B #\C)) '())
; letter?
(check-true (letter? #\A))
(check-true (letter? #\B))
(check-true (letter? #\C))
(check-true (letter? #\D))
(check-true (letter? #\E))
(check-true (letter? #\F))
(check-true (letter? #\G))
(check-true (letter? #\H))
(check-true (letter? #\I))
(check-true (letter? #\J))
(check-true (letter? #\K))
(check-true (letter? #\L))
(check-true (letter? #\M))
(check-true (letter? #\N))
(check-true (letter? #\O))
(check-true (letter? #\P))
(check-true (letter? #\Q))
(check-true (letter? #\R))
(check-true (letter? #\S))
(check-true (letter? #\T))
(check-true (letter? #\U))
(check-true (letter? #\V))
(check-true (letter? #\W))
(check-true (letter? #\X))
(check-true (letter? #\Y))
(check-true (letter? #\Z))
(check-true (letter? #\a))
(check-true (letter? #\b))
(check-true (letter? #\c))
(check-true (letter? #\d))
(check-true (letter? #\e))
(check-true (letter? #\f))
(check-true (letter? #\g))
(check-true (letter? #\h))
(check-true (letter? #\i))
(check-true (letter? #\j))
(check-true (letter? #\k))
(check-true (letter? #\l))
(check-true (letter? #\m))
(check-true (letter? #\n))
(check-true (letter? #\o))
(check-true (letter? #\p))
(check-true (letter? #\q))
(check-true (letter? #\r))
(check-true (letter? #\s))
(check-true (letter? #\t))
(check-true (letter? #\u))
(check-true (letter? #\v))
(check-true (letter? #\w))
(check-true (letter? #\x))
(check-true (letter? #\y))
(check-true (letter? #\z))
(check-false (letter? #\0))
(check-false (letter? #\1))
(check-false (letter? #\2))
(check-false (letter? #\3))
(check-false (letter? #\4))
(check-false (letter? #\5))
(check-false (letter? #\6))
(check-false (letter? #\7))
(check-false (letter? #\8))
(check-false (letter? #\9))
(check-false (letter? #\!))
(check-false (letter? #\#))
(check-false (letter? #\@))
(check-false (letter? #\_))
(check-false (letter? 'BT#))
(check-false (letter? 'SK@))
(check-false (letter? 'AR!))
(check-false (letter? '(#\A #\B #\C)))
(check-false (letter? '(#\1 #\2 #\3)))
(check-false (letter? '(1 2 3)))
(check-false (letter? '(A B C)))
(check-false (letter? '(A (B C))))
(check-false (letter? '()))
; letters-from
(check-equal? (letters-from '(#\A #\B #\C #\1 #\2 #\3)) '(#\A #\B #\C))
(check-equal? (letters-from '(#\Q #\1 #\S #\2 #\O #\3)) '(#\Q #\S #\O))
(check-equal? (letters-from '(A #\A #\9 Q #\B #\8 #\C M #\4)) '(#\A #\B #\C))
(check-equal? (letters-from '()) '())
(check-equal? (letters-from '(#\1 #\2 #\3)) '())
; letter+digit?
(check-true (letter+digit? #\A))
(check-true (letter+digit? #\B))
(check-true (letter+digit? #\C))
(check-true (letter+digit? #\D))
(check-true (letter+digit? #\E))
(check-true (letter+digit? #\F))
(check-true (letter+digit? #\G))
(check-true (letter+digit? #\H))
(check-true (letter+digit? #\I))
(check-true (letter+digit? #\J))
(check-true (letter+digit? #\K))
(check-true (letter+digit? #\L))
(check-true (letter+digit? #\M))
(check-true (letter+digit? #\N))
(check-true (letter+digit? #\O))
(check-true (letter+digit? #\P))
(check-true (letter+digit? #\Q))
(check-true (letter+digit? #\R))
(check-true (letter+digit? #\S))
(check-true (letter+digit? #\T))
(check-true (letter+digit? #\U))
(check-true (letter+digit? #\V))
(check-true (letter+digit? #\W))
(check-true (letter+digit? #\X))
(check-true (letter+digit? #\Y))
(check-true (letter+digit? #\Z))
(check-true (letter+digit? #\a))
(check-true (letter+digit? #\b))
(check-true (letter+digit? #\c))
(check-true (letter+digit? #\d))
(check-true (letter+digit? #\e))
(check-true (letter+digit? #\f))
(check-true (letter+digit? #\g))
(check-true (letter+digit? #\h))
(check-true (letter+digit? #\i))
(check-true (letter+digit? #\j))
(check-true (letter+digit? #\k))
(check-true (letter+digit? #\l))
(check-true (letter+digit? #\m))
(check-true (letter+digit? #\n))
(check-true (letter+digit? #\o))
(check-true (letter+digit? #\p))
(check-true (letter+digit? #\q))
(check-true (letter+digit? #\r))
(check-true (letter+digit? #\s))
(check-true (letter+digit? #\t))
(check-true (letter+digit? #\u))
(check-true (letter+digit? #\v))
(check-true (letter+digit? #\w))
(check-true (letter+digit? #\x))
(check-true (letter+digit? #\y))
(check-true (letter+digit? #\z))
(check-true (letter+digit? #\0))
(check-true (letter+digit? #\1))
(check-true (letter+digit? #\2))
(check-true (letter+digit? #\3))
(check-true (letter+digit? #\4))
(check-true (letter+digit? #\5))
(check-true (letter+digit? #\6))
(check-true (letter+digit? #\7))
(check-true (letter+digit? #\8))
(check-true (letter+digit? #\9))
(check-false (letter+digit? #\!))
(check-false (letter+digit? #\#))
(check-false (letter+digit? #\@))
(check-false (letter+digit? #\_))
(check-false (letter+digit? 'BT#))
(check-false (letter+digit? 'SK@))
(check-false (letter+digit? 'AR!))
(check-false (letter+digit? '(#\A #\B #\C)))
(check-false (letter+digit? '(#\1 #\2 #\3)))
(check-false (letter+digit? '(1 2 3)))
(check-false (letter+digit? '(A B C)))
(check-false (letter+digit? '(A (B C))))
(check-false (letter+digit? '()))
; letters+digits-from
(check-equal? (letters+digits-from '(#\A #\B #\C #\1 #\2 #\3))
'(#\A #\B #\C #\1 #\2 #\3))
(check-equal? (letters+digits-from '(#\Q #\1 #\S #\2 #\O #\3))
'(#\Q #\1 #\S #\2 #\O #\3))
(check-equal? (letters+digits-from '(A #\A #\9 Q #\B #\8 #\C M #\4))
'(#\A #\9 #\B #\8 #\C #\4))
(check-equal? (letters+digits-from '()) '())
(check-equal? (letters+digits-from '(#\1 #\2 #\3)) '(#\1 #\2 #\3))
; valid-country-prefix?
(check-equal? (valid-country-prefix? #\0) #f)
(check-equal? (valid-country-prefix? #\1) #f)
(check-equal? (valid-country-prefix? #\2) #t)
(check-equal? (valid-country-prefix? #\3) #t)
(check-equal? (valid-country-prefix? #\4) #t)
(check-equal? (valid-country-prefix? #\5) #t)
(check-equal? (valid-country-prefix? #\6) #t)
(check-equal? (valid-country-prefix? #\7) #t)
(check-equal? (valid-country-prefix? #\8) #t)
(check-equal? (valid-country-prefix? #\9) #t)
(check-equal? (valid-country-prefix? #\A) #t)
(check-equal? (valid-country-prefix? #\B) #t)
(check-equal? (valid-country-prefix? #\C) #t)
(check-equal? (valid-country-prefix? #\D) #t)
(check-equal? (valid-country-prefix? #\E) #t)
(check-equal? (valid-country-prefix? #\F) #t)
(check-equal? (valid-country-prefix? #\G) #t)
(check-equal? (valid-country-prefix? #\H) #t)
(check-equal? (valid-country-prefix? #\I) #t)
(check-equal? (valid-country-prefix? #\J) #t)
(check-equal? (valid-country-prefix? #\K) #t)
(check-equal? (valid-country-prefix? #\L) #t)
(check-equal? (valid-country-prefix? #\M) #t)
(check-equal? (valid-country-prefix? #\N) #t)
(check-equal? (valid-country-prefix? #\O) #t)
(check-equal? (valid-country-prefix? #\P) #t)
(check-equal? (valid-country-prefix? #\Q) #f)
(check-equal? (valid-country-prefix? #\R) #t)
(check-equal? (valid-country-prefix? #\S) #t)
(check-equal? (valid-country-prefix? #\T) #t)
(check-equal? (valid-country-prefix? #\U) #t)
(check-equal? (valid-country-prefix? #\V) #t)
(check-equal? (valid-country-prefix? #\W) #t)
(check-equal? (valid-country-prefix? #\X) #t)
(check-equal? (valid-country-prefix? #\Y) #t)
(check-equal? (valid-country-prefix? #\Z) #t)
(check-equal? (valid-country-prefix? #\.) #f)
(check-equal? (valid-country-prefix? #\/) #f)
(check-equal? (valid-country-prefix? #\,) #f)
(check-equal? (valid-country-prefix? #\?) #f)
(check-equal? (valid-country-prefix? 'BT#) #f)
(check-equal? (valid-country-prefix? 'SK@) #f)
(check-equal? (valid-country-prefix? 'AR!) #f)
; minimum-country-prefix-length
(check-equal? (minimum-country-prefix-length #\0) -1)
(check-equal? (minimum-country-prefix-length #\1) -1)
(check-equal? (minimum-country-prefix-length #\2) 1)
(check-equal? (minimum-country-prefix-length #\3) 2)
(check-equal? (minimum-country-prefix-length #\4) 2)
(check-equal? (minimum-country-prefix-length #\5) 2)
(check-equal? (minimum-country-prefix-length #\6) 2)
(check-equal? (minimum-country-prefix-length #\7) 2)
(check-equal? (minimum-country-prefix-length #\8) 2)
(check-equal? (minimum-country-prefix-length #\9) 2)
(check-equal? (minimum-country-prefix-length #\A) 2)
(check-equal? (minimum-country-prefix-length #\B) 1)
(check-equal? (minimum-country-prefix-length #\C) 2)
(check-equal? (minimum-country-prefix-length #\D) 2)
(check-equal? (minimum-country-prefix-length #\E) 2)
(check-equal? (minimum-country-prefix-length #\F) 1)
(check-equal? (minimum-country-prefix-length #\G) 1)
(check-equal? (minimum-country-prefix-length #\H) 2)
(check-equal? (minimum-country-prefix-length #\I) 1)
(check-equal? (minimum-country-prefix-length #\J) 2)
(check-equal? (minimum-country-prefix-length #\K) 1)
(check-equal? (minimum-country-prefix-length #\L) 2)
(check-equal? (minimum-country-prefix-length #\M) 1)
(check-equal? (minimum-country-prefix-length #\N) 1)
(check-equal? (minimum-country-prefix-length #\O) 2)
(check-equal? (minimum-country-prefix-length #\P) 2)
(check-equal? (minimum-country-prefix-length #\Q) -1)
(check-equal? (minimum-country-prefix-length #\R) 1)
(check-equal? (minimum-country-prefix-length #\S) 2)
(check-equal? (minimum-country-prefix-length #\T) 2)
(check-equal? (minimum-country-prefix-length #\U) 2)
(check-equal? (minimum-country-prefix-length #\V) 2)
(check-equal? (minimum-country-prefix-length #\W) 1)
(check-equal? (minimum-country-prefix-length #\X) 2)
(check-equal? (minimum-country-prefix-length #\Y) 2)
(check-equal? (minimum-country-prefix-length #\Z) 2)
(check-equal? (minimum-country-prefix-length #\.) -1)
(check-equal? (minimum-country-prefix-length #\/) -1)
(check-equal? (minimum-country-prefix-length #\,) -1)
(check-equal? (minimum-country-prefix-length #\?) -1)
(check-equal? (minimum-country-prefix-length 'BT#) -1)
(check-equal? (minimum-country-prefix-length 'SK@) -1)
(check-equal? (minimum-country-prefix-length 'AR!) -1)
; allow-numeral-in-country-prefix?
(check-equal? (allow-numeral-in-country-prefix? #\0) #f)
(check-equal? (allow-numeral-in-country-prefix? #\1) #f)
(check-equal? (allow-numeral-in-country-prefix? #\2) #f)
(check-equal? (allow-numeral-in-country-prefix? #\3) #f)
(check-equal? (allow-numeral-in-country-prefix? #\4) #f)
(check-equal? (allow-numeral-in-country-prefix? #\5) #f)
(check-equal? (allow-numeral-in-country-prefix? #\6) #f)
(check-equal? (allow-numeral-in-country-prefix? #\7) #f)
(check-equal? (allow-numeral-in-country-prefix? #\8) #f)
(check-equal? (allow-numeral-in-country-prefix? #\9) #f)
(check-equal? (allow-numeral-in-country-prefix? #\A) #t)
(check-equal? (allow-numeral-in-country-prefix? #\B) #f)
(check-equal? (allow-numeral-in-country-prefix? #\C) #t)
(check-equal? (allow-numeral-in-country-prefix? #\D) #t)
(check-equal? (allow-numeral-in-country-prefix? #\E) #t)
(check-equal? (allow-numeral-in-country-prefix? #\F) #f)
(check-equal? (allow-numeral-in-country-prefix? #\G) #f)
(check-equal? (allow-numeral-in-country-prefix? #\H) #t)
(check-equal? (allow-numeral-in-country-prefix? #\I) #f)
(check-equal? (allow-numeral-in-country-prefix? #\J) #t)
(check-equal? (allow-numeral-in-country-prefix? #\K) #f)
(check-equal? (allow-numeral-in-country-prefix? #\L) #t)
(check-equal? (allow-numeral-in-country-prefix? #\M) #f)
(check-equal? (allow-numeral-in-country-prefix? #\N) #f)
(check-equal? (allow-numeral-in-country-prefix? #\O) #f)
(check-equal? (allow-numeral-in-country-prefix? #\P) #t)
(check-equal? (allow-numeral-in-country-prefix? #\Q) #f)
(check-equal? (allow-numeral-in-country-prefix? #\R) #f)
(check-equal? (allow-numeral-in-country-prefix? #\S) #t)
(check-equal? (allow-numeral-in-country-prefix? #\T) #t)
(check-equal? (allow-numeral-in-country-prefix? #\U) #f)
(check-equal? (allow-numeral-in-country-prefix? #\V) #t)
(check-equal? (allow-numeral-in-country-prefix? #\W) #f)
(check-equal? (allow-numeral-in-country-prefix? #\X) #f)
(check-equal? (allow-numeral-in-country-prefix? #\Y) #t)
(check-equal? (allow-numeral-in-country-prefix? #\Z) #t)
(check-equal? (allow-numeral-in-country-prefix? #\.) #f)
(check-equal? (allow-numeral-in-country-prefix? #\/) #f)
(check-equal? (allow-numeral-in-country-prefix? #\,) #f)
(check-equal? (allow-numeral-in-country-prefix? #\?) #f)
(check-equal? (allow-numeral-in-country-prefix? 'BT#) #f)
(check-equal? (allow-numeral-in-country-prefix? 'SK@) #f)
(check-equal? (allow-numeral-in-country-prefix? 'AR!) #f)
; generate-country
; This function can do random stuff, but we are currently only testing its
; non-random behavior.
(let ([max-country-length 3] [min-country-length 1])
(check-equal? (generate-country 1 '(#\D)) '())
(check-equal? (generate-country 2 '(#\D)) '(#\D #\D))
(check-equal? (generate-country 3 '(#\D)) '(#\D #\D #\D))
(check-equal? (generate-country 1 '(#\J)) '())
(check-equal? (generate-country 2 '(#\J)) '(#\J #\J))
(check-equal? (generate-country 1 '(#\K)) '(#\K))
(check-equal? (generate-country 2 '(#\K)) '(#\K #\K))
(check-equal? (generate-country 0 '(#\W)) '())
(check-equal? (generate-country 1 '(#\W)) '(#\W))
(check-equal? (generate-country 2 '(#\W)) '(#\W #\W))
(check-equal? (generate-country 3 '(#\W)) '(#\W #\W #\W))
(check-equal? (generate-country 1 '(#\.)) '())
(check-equal? (generate-country 1 '(#\0)) '())
(check-equal? (generate-country 1 '(#\,)) '())
(check-equal? (generate-country 1 '(#\/)) '())
(check-equal? (generate-country 1 '(#\Q)) '())
(check-equal? (generate-country 1 '(#\?)) '())
(check-equal? (generate-country 1 '(#\1)) '())
(check-equal? (generate-country 1 '(#\D #\Q)) '())
(check-equal? (generate-country 1 '(#\W #\Q)) '(#\W))
(check <= (length (generate-country 3 '(#\K #\M))) max-country-length)
(check >= (length (generate-country 3 '(#\K #\M))) min-country-length)
(check <= (length (generate-country 3 '(#\K #\M #\1))) max-country-length)
(check >= (length (generate-country 3 '(#\K #\M #\1))) min-country-length)
(check <= (length (generate-country 3 '(#\1))) max-country-length))
; in-range?
(check-equal? (in-range? #\F #\A #\Z) #t)
(check-equal? (in-range? #\A #\A #\Z) #t)
(check-equal? (in-range? #\Z #\A #\Z) #t)
(check-equal? (in-range? #\0 #\A #\Z) #f)
(check-equal? (in-range? #\, #\A #\Z) #f)
; bahamas-callsign?
(check-equal? (bahamas-callsign? '(#\C #\6 #\A)) #t)
(check-equal? (bahamas-callsign? '(#\C #\6 #\Z)) #t)
(check-equal? (bahamas-callsign? '(#\C #\6 #\Z #\Q #\N)) #t)
(check-equal? (bahamas-callsign? '(#\C #\6 #\0)) #f)
(check-equal? (bahamas-callsign? '(#\C #\6 #\9)) #f)
(check-equal? (bahamas-callsign? '(#\C #\6 #\,)) #f)
(check-equal? (bahamas-callsign? '(#\C #\6)) #f)
(check-equal? (bahamas-callsign? '(#\B)) #f)
(check-equal? (bahamas-callsign? '()) #f)
(check-equal? (bahamas-callsign? '(#\N #\1 #\I #\R #\Z)) #f)
; generate-separating-numeral
; This function can do random stuff, but we are currently only testing its
; non-random behavior.
(check-equal? (generate-separating-numeral '(#\N) '(#\1)) '(#\1))
(check-equal? (generate-separating-numeral '(#\Q) '(#\2)) '(#\2))
(check-equal? (generate-separating-numeral '(#\B) '(#\3)) '(#\3))
(check-equal? (generate-separating-numeral '(#\N) '()) '())
(check-equal? (generate-separating-numeral '(#\C #\6 #\A) '(#\1)) '())
(check-equal? (generate-separating-numeral '(#\C #\6 #\0) '(#\1)) '(#\1))
; generate-suffix
; This function can do random stuff, but we are currently only testing its
; non-random behavior.
(check-equal? (generate-suffix 0 '(#\K #\M)) '())
; never end in a number, even when that's all you have available
(check-equal? (generate-suffix 1 '(#\1)) '())
(check-equal? (length (generate-suffix 1 '(#\K #\M))) 1)
(check-equal? (length (generate-suffix 2 '(#\K #\M))) 2)
(check-equal? (length (generate-suffix 3 '(#\K #\M))) 3)
(check-equal? (length (generate-suffix 4 '(#\K #\M))) 4)
(check-equal? (generate-suffix 4 '(#\K)) '(#\K #\K #\K #\K))
(check-equal? (generate-suffix 3 '(#\K)) '(#\K #\K #\K))
(check-equal? (generate-suffix 3 '(#\M)) '(#\M #\M #\M))
(check-equal? (generate-suffix 2 '(#\M)) '(#\M #\M))
(check-equal? (generate-suffix 1 '(#\M)) '(#\M))
; generate-random-callsign
; This function can do random stuff, but we are currently only testing its
; non-random behavior.
(let ([max-callsign-length (+ 3 1 4)] [min-callsign-length (+ 1 1 1)])
(check <= (length (generate-random-callsign '(#\K #\M))) max-callsign-length)
(check >= (length (generate-random-callsign '(#\K #\M))) min-callsign-length)
(check <= (length (generate-random-callsign '(#\K #\M #\1))) max-callsign-length)
(check >= (length (generate-random-callsign '(#\K #\M #\1))) min-callsign-length)
(check <= (length (generate-random-callsign '(#\1))) max-callsign-length)
(check >= (length (generate-random-callsign '(#\1))) min-callsign-length))