Artifact
8fcf733fb42e7db69e55b6534e5e138b3181bb59 :
File
tests/tests.scm
— part of check-in
[3e4d4b9027]
at
2011-08-10 21:57:40
on branch rollup-runs
— Rollup runs, clean up tests
(user:
mrwellan
size: 3800)
[more...]
0000: 28 75 73 65 20 74 65 73 74 29 0a 3b 3b 20 28 72 (use test).;; (r
0010: 65 71 75 69 72 65 2d 6c 69 62 72 61 72 79 20 61 equire-library a
0020: 72 67 73 29 0a 0a 28 69 6e 63 6c 75 64 65 20 22 rgs)..(include "
0030: 2e 2e 2f 63 6f 6d 6d 6f 6e 2e 73 63 6d 22 29 0a ../common.scm").
0040: 28 69 6e 63 6c 75 64 65 20 22 2e 2e 2f 6b 65 79 (include "../key
0050: 73 2e 73 63 6d 22 29 0a 28 69 6e 63 6c 75 64 65 s.scm").(include
0060: 20 22 2e 2e 2f 64 62 2e 73 63 6d 22 29 0a 28 69 "../db.scm").(i
0070: 6e 63 6c 75 64 65 20 22 2e 2e 2f 63 6f 6e 66 69 nclude "../confi
0080: 67 66 2e 73 63 6d 22 29 0a 28 69 6e 63 6c 75 64 gf.scm").(includ
0090: 65 20 22 2e 2e 2f 70 72 6f 63 65 73 73 2e 73 63 e "../process.sc
00a0: 6d 22 29 0a 28 69 6e 63 6c 75 64 65 20 22 2e 2e m").(include "..
00b0: 2f 6c 61 75 6e 63 68 2e 73 63 6d 22 29 0a 28 69 /launch.scm").(i
00c0: 6e 63 6c 75 64 65 20 22 2e 2e 2f 69 74 65 6d 73 nclude "../items
00d0: 2e 73 63 6d 22 29 0a 28 69 6e 63 6c 75 64 65 20 .scm").(include
00e0: 22 2e 2e 2f 72 75 6e 73 2e 73 63 6d 22 29 0a 28 "../runs.scm").(
00f0: 69 6e 63 6c 75 64 65 20 22 2e 2e 2f 6d 65 67 61 include "../mega
0100: 74 65 73 74 2d 76 65 72 73 69 6f 6e 2e 73 63 6d test-version.scm
0110: 22 29 0a 0a 28 64 65 66 69 6e 65 20 63 6f 6e 66 ")..(define conf
0120: 66 69 6c 65 20 23 66 29 0a 28 74 65 73 74 20 22 file #f).(test "
0130: 52 65 61 64 20 61 20 63 6f 6e 66 69 67 22 20 23 Read a config" #
0140: 74 20 28 68 61 73 68 2d 74 61 62 6c 65 3f 20 28 t (hash-table? (
0150: 72 65 61 64 2d 63 6f 6e 66 69 67 20 22 74 65 73 read-config "tes
0160: 74 2e 63 6f 6e 66 69 67 22 29 29 29 0a 28 74 65 t.config"))).(te
0170: 73 74 20 22 52 65 61 64 20 61 20 63 6f 6e 66 69 st "Read a confi
0180: 67 20 74 68 61 74 20 64 6f 65 73 6e 27 74 20 65 g that doesn't e
0190: 78 69 73 74 22 20 23 74 20 28 68 61 73 68 2d 74 xist" #t (hash-t
01a0: 61 62 6c 65 3f 20 28 72 65 61 64 2d 63 6f 6e 66 able? (read-conf
01b0: 69 67 20 22 6e 61 64 61 2e 63 6f 6e 66 69 67 22 ig "nada.config"
01c0: 29 29 29 0a 0a 28 73 65 74 21 20 63 6f 6e 66 66 )))..(set! conff
01d0: 69 6c 65 20 28 72 65 61 64 2d 63 6f 6e 66 69 67 ile (read-config
01e0: 20 22 74 65 73 74 2e 63 6f 6e 66 69 67 22 29 29 "test.config"))
01f0: 0a 28 74 65 73 74 20 22 47 65 74 20 61 76 61 69 .(test "Get avai
0200: 6c 61 62 6c 65 20 64 69 73 6b 73 70 61 63 65 22 lable diskspace"
0210: 20 23 74 20 28 6e 75 6d 62 65 72 3f 20 28 67 65 #t (number? (ge
0220: 74 2d 64 66 20 22 2e 2f 22 29 29 29 0a 28 74 65 t-df "./"))).(te
0230: 73 74 20 22 47 65 74 20 62 65 73 74 20 64 69 72 st "Get best dir
0240: 22 20 23 74 20 28 6c 65 74 20 28 28 62 65 73 74 " #t (let ((best
0250: 64 69 72 20 28 67 65 74 2d 62 65 73 74 2d 64 69 dir (get-best-di
0260: 73 6b 20 63 6f 6e 66 66 69 6c 65 29 29 29 0a 09 sk conffile)))..
0270: 09 09 20 20 20 20 20 20 28 6f 72 20 28 65 71 75 .. (or (equ
0280: 61 6c 3f 20 22 2e 2f 22 20 20 20 62 65 73 74 64 al? "./" bestd
0290: 69 72 29 0a 09 09 09 09 20 20 28 65 71 75 61 6c ir)..... (equal
02a0: 3f 20 22 2f 74 6d 70 22 20 62 65 73 74 64 69 72 ? "/tmp" bestdir
02b0: 29 29 29 29 0a 28 74 65 73 74 20 22 4d 75 6c 74 )))).(test "Mult
02c0: 69 6c 69 6e 65 20 76 61 72 69 61 62 6c 65 22 20 iline variable"
02d0: 34 20 28 6c 65 6e 67 74 68 20 28 73 74 72 69 6e 4 (length (strin
02e0: 67 2d 73 70 6c 69 74 20 28 63 6f 6e 66 69 67 2d g-split (config-
02f0: 6c 6f 6f 6b 75 70 20 63 6f 6e 66 66 69 6c 65 20 lookup conffile
0300: 22 6d 65 74 61 64 61 74 61 22 20 22 64 65 73 63 "metadata" "desc
0310: 72 69 70 74 69 6f 6e 22 29 20 22 5c 6e 22 29 29 ription") "\n"))
0320: 29 0a 0a 3b 3b 20 64 62 0a 28 64 65 66 69 6e 65 )..;; db.(define
0330: 20 72 6f 77 20 20 20 20 28 76 65 63 74 6f 72 20 row (vector
0340: 22 61 22 20 22 62 22 20 22 63 22 20 22 62 6c 61 "a" "b" "c" "bla
0350: 68 22 29 29 0a 28 64 65 66 69 6e 65 20 68 65 61 h")).(define hea
0360: 64 65 72 20 28 6c 69 73 74 20 22 63 6f 6c 31 22 der (list "col1"
0370: 20 22 63 6f 6c 32 22 20 22 63 6f 6c 33 22 20 22 "col2" "col3" "
0380: 63 6f 6c 34 22 29 29 0a 28 74 65 73 74 20 22 47 col4")).(test "G
0390: 65 74 20 72 6f 77 20 62 79 20 68 65 61 64 65 72 et row by header
03a0: 22 20 22 62 6c 61 68 22 20 28 64 62 3a 67 65 74 " "blah" (db:get
03b0: 2d 76 61 6c 75 65 2d 62 79 2d 68 65 61 64 65 72 -value-by-header
03c0: 20 72 6f 77 20 68 65 61 64 65 72 20 22 63 6f 6c row header "col
03d0: 34 22 29 29 0a 0a 3b 3b 20 28 64 65 66 69 6e 65 4"))..;; (define
03e0: 20 2a 74 6f 70 70 61 74 68 2a 20 22 74 65 73 74 *toppath* "test
03f0: 73 22 29 0a 28 64 65 66 69 6e 65 20 2a 64 62 2a s").(define *db*
0400: 20 23 66 29 0a 28 74 65 73 74 20 22 73 65 74 75 #f).(test "setu
0410: 70 20 66 6f 72 20 72 75 6e 22 20 23 74 20 28 62 p for run" #t (b
0420: 65 67 69 6e 20 28 73 65 74 75 70 2d 66 6f 72 2d egin (setup-for-
0430: 72 75 6e 29 0a 09 09 09 09 28 73 74 72 69 6e 67 run).....(string
0440: 3f 20 28 67 65 74 65 6e 76 20 22 4d 54 5f 52 55 ? (getenv "MT_RU
0450: 4e 5f 41 52 45 41 5f 48 4f 4d 45 22 29 29 29 29 N_AREA_HOME"))))
0460: 0a 28 74 65 73 74 20 22 6f 70 65 6e 2d 64 62 22 .(test "open-db"
0470: 20 23 74 20 28 62 65 67 69 6e 0a 09 09 20 20 20 #t (begin...
0480: 20 20 28 73 65 74 21 20 2a 64 62 2a 20 28 6f 70 (set! *db* (op
0490: 65 6e 2d 64 62 29 29 0a 09 09 20 20 20 20 20 28 en-db))... (
04a0: 69 66 20 2a 64 62 2a 20 23 74 20 23 66 29 29 29 if *db* #t #f)))
04b0: 0a 0a 3b 3b 20 71 75 69 74 20 77 61 73 74 69 6e ..;; quit wastin
04c0: 67 20 74 69 6d 65 20 63 68 61 6e 67 69 6e 67 20 g time changing
04d0: 64 62 20 74 6f 20 2a 64 62 2a 0a 28 64 65 66 69 db to *db*.(defi
04e0: 6e 65 20 64 62 20 2a 64 62 2a 29 0a 0a 28 74 65 ne db *db*)..(te
04f0: 73 74 20 22 67 65 74 20 63 70 75 20 6c 6f 61 64 st "get cpu load
0500: 22 20 23 74 20 28 6e 75 6d 62 65 72 3f 20 28 67 " #t (number? (g
0510: 65 74 2d 63 70 75 2d 6c 6f 61 64 29 29 29 0a 28 et-cpu-load))).(
0520: 74 65 73 74 20 22 67 65 74 20 75 6e 61 6d 65 22 test "get uname"
0530: 20 20 20 20 23 74 20 28 73 74 72 69 6e 67 3f 20 #t (string?
0540: 28 67 65 74 2d 75 6e 61 6d 65 29 29 29 0a 0a 28 (get-uname)))..(
0550: 74 65 73 74 20 22 67 65 74 20 76 61 6c 69 64 76 test "get validv
0560: 61 6c 75 65 73 20 61 73 20 6c 69 73 74 22 20 28 alues as list" (
0570: 6c 69 73 74 20 22 73 74 61 72 74 22 20 22 65 6e list "start" "en
0580: 64 22 20 22 63 6f 6d 70 6c 65 74 65 64 22 29 0a d" "completed").
0590: 20 20 20 20 20 20 28 73 74 72 69 6e 67 2d 73 70 (string-sp
05a0: 6c 69 74 20 28 63 6f 6e 66 69 67 2d 6c 6f 6f 6b lit (config-look
05b0: 75 70 20 2a 63 6f 6e 66 69 67 64 61 74 2a 20 22 up *configdat* "
05c0: 76 61 6c 69 64 76 61 6c 75 65 73 22 20 22 73 74 validvalues" "st
05d0: 61 74 65 22 29 29 29 0a 0a 28 66 6f 72 2d 65 61 ate")))..(for-ea
05e0: 63 68 20 28 6c 61 6d 62 64 61 20 28 69 74 65 6d ch (lambda (item
05f0: 29 0a 09 20 20 20 20 28 74 65 73 74 20 28 63 6f ).. (test (co
0600: 6e 63 20 22 67 65 74 20 76 61 6c 69 64 20 69 74 nc "get valid it
0610: 65 6d 73 20 28 22 20 69 74 65 6d 20 22 29 22 29 ems (" item ")")
0620: 0a 09 09 20 20 69 74 65 6d 20 28 63 68 65 63 6b ... item (check
0630: 2d 76 61 6c 69 64 2d 69 74 65 6d 73 20 22 73 74 -valid-items "st
0640: 61 74 65 22 20 69 74 65 6d 29 29 29 0a 09 20 20 ate" item)))..
0650: 28 6c 69 73 74 20 22 73 74 61 72 74 22 20 22 65 (list "start" "e
0660: 6e 64 22 20 22 63 6f 6d 70 6c 65 74 65 64 22 29 nd" "completed")
0670: 29 0a 0a 28 66 6f 72 2d 65 61 63 68 20 28 6c 61 )..(for-each (la
0680: 6d 62 64 61 20 28 69 74 65 6d 29 0a 09 20 20 20 mbda (item)..
0690: 20 28 74 65 73 74 20 28 63 6f 6e 63 20 22 67 65 (test (conc "ge
06a0: 74 20 76 61 6c 69 64 20 69 74 65 6d 73 20 28 22 t valid items ("
06b0: 20 69 74 65 6d 20 22 29 22 29 0a 09 09 20 20 69 item ")")... i
06c0: 74 65 6d 20 28 63 68 65 63 6b 2d 76 61 6c 69 64 tem (check-valid
06d0: 2d 69 74 65 6d 73 20 22 73 74 61 74 75 73 22 20 -items "status"
06e0: 69 74 65 6d 29 29 29 0a 09 20 20 28 6c 69 73 74 item))).. (list
06f0: 20 22 70 61 73 73 22 20 22 66 61 69 6c 22 20 22 "pass" "fail" "
0700: 6e 2f 61 22 29 29 0a 0a 28 74 65 73 74 20 22 77 n/a"))..(test "w
0710: 72 69 74 65 20 65 6e 76 20 66 69 6c 65 73 22 20 rite env files"
0720: 22 6e 61 64 61 2e 63 73 68 22 20 28 62 65 67 69 "nada.csh" (begi
0730: 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 n.
0740: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0750: 20 20 20 20 20 20 20 20 28 73 61 76 65 2d 65 6e (save-en
0760: 76 69 72 6f 6e 6d 65 6e 74 2d 61 73 2d 66 69 6c vironment-as-fil
0770: 65 73 20 22 6e 61 64 61 22 29 0a 20 20 20 20 20 es "nada").
0780: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0790: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
07a0: 20 28 61 6e 64 20 28 66 69 6c 65 2d 65 78 69 73 (and (file-exis
07b0: 74 73 3f 20 22 6e 61 64 61 2e 73 68 22 29 0a 20 ts? "nada.sh").
07c0: 20 20 20 09 09 09 20 20 20 20 20 20 20 20 20 20 ...
07d0: 20 20 20 20 20 20 20 28 66 69 6c 65 2d 65 78 69 (file-exi
07e0: 73 74 73 3f 20 22 6e 61 64 61 2e 63 73 68 22 29 sts? "nada.csh")
07f0: 29 29 29 0a 0a 28 74 65 73 74 20 22 67 65 74 20 )))..(test "get
0800: 61 6c 6c 20 6c 65 67 61 6c 20 74 65 73 74 73 22 all legal tests"
0810: 20 28 6c 69 73 74 20 22 72 75 6e 66 69 72 73 74 (list "runfirst
0820: 22 20 22 72 75 6e 77 69 74 68 66 69 72 73 74 22 " "runwithfirst"
0830: 20 22 73 69 6e 67 6c 65 74 65 73 74 22 20 22 73 "singletest" "s
0840: 69 6e 67 6c 65 74 65 73 74 32 22 20 22 73 71 6c ingletest2" "sql
0850: 69 74 65 73 70 65 65 64 22 29 20 28 73 6f 72 74 itespeed") (sort
0860: 20 28 67 65 74 2d 61 6c 6c 2d 6c 65 67 61 6c 2d (get-all-legal-
0870: 74 65 73 74 73 29 20 73 74 72 69 6e 67 3c 3d 3f tests) string<=?
0880: 29 29 0a 0a 28 74 65 73 74 20 22 72 65 67 69 73 ))..(test "regis
0890: 74 65 72 2d 74 65 73 74 2c 20 74 65 73 74 20 69 ter-test, test i
08a0: 6e 66 6f 22 20 22 4e 4f 54 5f 53 54 41 52 54 45 nfo" "NOT_STARTE
08b0: 44 22 0a 20 20 20 20 20 20 28 62 65 67 69 6e 0a D". (begin.
08c0: 09 28 72 65 67 69 73 74 65 72 2d 74 65 73 74 20 .(register-test
08d0: 2a 64 62 2a 20 31 20 22 6e 61 64 61 22 20 22 22 *db* 1 "nada" ""
08e0: 20 27 28 22 74 61 67 31 22 20 22 74 61 67 32 22 '("tag1" "tag2"
08f0: 20 22 74 61 67 33 22 29 29 0a 09 28 74 65 73 74 "tag3"))..(test
0900: 3a 67 65 74 2d 73 74 61 74 65 20 28 64 62 3a 67 :get-state (db:g
0910: 65 74 2d 74 65 73 74 2d 69 6e 66 6f 20 2a 64 62 et-test-info *db
0920: 2a 20 31 20 22 6e 61 64 61 22 20 22 22 29 29 29 * 1 "nada" "")))
0930: 29 0a 0a 28 74 65 73 74 20 22 67 65 74 2d 6b 65 )..(test "get-ke
0940: 79 73 22 20 22 73 79 73 6e 61 6d 65 22 20 28 6b ys" "sysname" (k
0950: 65 79 3a 67 65 74 2d 66 69 65 6c 64 6e 61 6d 65 ey:get-fieldname
0960: 20 28 63 61 72 20 28 73 6f 72 74 20 28 64 62 2d (car (sort (db-
0970: 67 65 74 2d 6b 65 79 73 20 2a 64 62 2a 29 28 6c get-keys *db*)(l
0980: 61 6d 62 64 61 20 28 61 20 62 29 28 73 74 72 69 ambda (a b)(stri
0990: 6e 67 3e 3d 3f 20 28 76 65 63 74 6f 72 2d 72 65 ng>=? (vector-re
09a0: 66 20 61 20 30 29 28 76 65 63 74 6f 72 2d 72 65 f a 0)(vector-re
09b0: 66 20 62 20 30 29 29 29 29 29 29 29 0a 0a 28 64 f b 0)))))))..(d
09c0: 65 66 69 6e 65 20 72 65 6d 61 72 67 73 20 28 61 efine remargs (a
09d0: 72 67 73 3a 67 65 74 2d 61 72 67 73 0a 09 09 20 rgs:get-args...
09e0: 27 28 22 62 61 72 22 20 22 66 6f 6f 22 20 22 3a '("bar" "foo" ":
09f0: 72 75 6e 6e 61 6d 65 22 20 22 62 6f 62 22 20 22 runname" "bob" "
0a00: 3a 73 79 73 6e 61 6d 65 22 20 22 75 62 75 6e 74 :sysname" "ubunt
0a10: 75 22 20 22 3a 66 73 6e 61 6d 65 22 20 22 6e 66 u" ":fsname" "nf
0a20: 73 22 20 22 3a 64 61 74 61 70 61 74 68 22 20 22 s" ":datapath" "
0a30: 62 6c 61 68 2f 66 6f 6f 22 20 22 6e 61 64 61 22 blah/foo" "nada"
0a40: 29 0a 09 09 20 28 6c 69 73 74 20 22 3a 72 75 6e )... (list ":run
0a50: 6e 61 6d 65 22 20 22 3a 73 74 61 74 65 22 20 22 name" ":state" "
0a60: 3a 73 74 61 74 75 73 22 29 0a 09 09 20 28 6c 69 :status")... (li
0a70: 73 74 20 22 2d 68 22 29 0a 09 09 20 61 72 67 73 st "-h")... args
0a80: 3a 61 72 67 2d 68 61 73 68 0a 09 09 20 30 29 29 :arg-hash... 0))
0a90: 0a 0a 28 74 65 73 74 20 22 72 65 67 69 73 74 65 ..(test "registe
0aa0: 72 2d 72 75 6e 22 20 23 74 20 28 6e 75 6d 62 65 r-run" #t (numbe
0ab0: 72 3f 20 28 72 65 67 69 73 74 65 72 2d 72 75 6e r? (register-run
0ac0: 20 2a 64 62 2a 20 28 64 62 2d 67 65 74 2d 6b 65 *db* (db-get-ke
0ad0: 79 73 20 2a 64 62 2a 29 29 29 29 0a 0a 3b 3b 28 ys *db*))))..;;(
0ae0: 74 65 73 74 20 22 75 70 64 61 74 65 2d 74 65 73 test "update-tes
0af0: 74 2d 69 6e 66 6f 22 20 23 74 20 28 74 65 73 74 t-info" #t (test
0b00: 2d 75 70 64 61 74 65 2d 6d 65 74 61 2d 69 6e 66 -update-meta-inf
0b10: 6f 20 2a 64 62 2a 20 31 20 22 6e 61 64 61 22 20 o *db* 1 "nada"
0b20: 0a 28 73 65 74 65 6e 76 20 22 42 4c 41 48 46 4f .(setenv "BLAHFO
0b30: 4f 22 20 22 31 32 33 34 22 29 0a 28 75 6e 73 65 O" "1234").(unse
0b40: 74 65 6e 76 20 22 4e 41 44 41 46 4f 4f 22 29 0a tenv "NADAFOO").
0b50: 28 74 65 73 74 20 22 65 6e 76 20 74 65 6d 70 20 (test "env temp
0b60: 6f 76 65 72 72 69 64 65 73 22 20 22 78 79 7a 22 overrides" "xyz"
0b70: 20 28 6c 65 74 20 28 28 70 72 65 76 76 61 6c 73 (let ((prevvals
0b80: 20 28 61 6c 69 73 74 2d 3e 65 6e 76 2d 76 61 72 (alist->env-var
0b90: 73 20 27 28 28 22 42 4c 41 48 46 4f 4f 22 20 34 s '(("BLAHFOO" 4
0ba0: 33 32 31 29 28 22 4e 41 44 41 46 4f 4f 22 20 78 321)("NADAFOO" x
0bb0: 79 7a 29 29 29 29 0a 09 09 09 09 20 20 20 20 20 yz)))).....
0bc0: 20 20 28 72 65 73 75 6c 74 20 20 20 28 67 65 74 (result (get
0bd0: 2d 65 6e 76 69 72 6f 6e 6d 65 6e 74 2d 76 61 72 -environment-var
0be0: 69 61 62 6c 65 20 22 4e 41 44 41 46 4f 4f 22 29 iable "NADAFOO")
0bf0: 29 29 0a 09 09 09 09 20 20 20 20 28 61 6c 69 73 ))..... (alis
0c00: 74 2d 3e 65 6e 76 2d 76 61 72 73 20 70 72 65 76 t->env-vars prev
0c10: 76 61 6c 73 29 0a 09 09 09 09 20 20 20 20 72 65 vals)..... re
0c20: 73 75 6c 74 29 29 0a 0a 28 74 65 73 74 20 22 65 sult))..(test "e
0c30: 6e 76 20 72 65 73 74 6f 72 65 64 22 20 22 31 32 nv restored" "12
0c40: 33 34 22 20 28 67 65 74 2d 65 6e 76 69 72 6f 6e 34" (get-environ
0c50: 6d 65 6e 74 2d 76 61 72 69 61 62 6c 65 20 22 42 ment-variable "B
0c60: 4c 41 48 46 4f 4f 22 29 29 0a 0a 0a 28 74 65 73 LAHFOO"))...(tes
0c70: 74 20 22 49 74 65 6d 73 20 61 73 73 6f 63 22 20 t "Items assoc"
0c80: 22 45 6c 65 70 68 61 6e 74 22 20 28 63 61 64 61 "Elephant" (cada
0c90: 72 20 28 63 61 64 72 20 28 69 74 65 6d 2d 61 73 r (cadr (item-as
0ca0: 73 6f 63 2d 3e 69 74 65 6d 2d 6c 69 73 74 20 27 soc->item-list '
0cb0: 28 28 22 41 4e 49 4d 41 4c 22 20 22 45 6c 65 70 (("ANIMAL" "Elep
0cc0: 68 61 6e 74 20 4c 69 6f 6e 22 29 28 22 53 45 41 hant Lion")("SEA
0cd0: 53 4f 4e 22 20 22 53 70 72 69 6e 67 20 46 61 6c SON" "Spring Fal
0ce0: 6c 22 29 29 29 29 29 29 0a 28 73 65 74 21 20 2a l")))))).(set! *
0cf0: 76 65 72 62 6f 73 69 74 79 2a 20 36 29 0a 28 74 verbosity* 6).(t
0d00: 65 73 74 20 22 49 74 65 6d 73 20 61 73 73 6f 63 est "Items assoc
0d10: 22 20 27 28 29 28 69 74 65 6d 2d 61 73 73 6f 63 " '()(item-assoc
0d20: 2d 3e 69 74 65 6d 2d 6c 69 73 74 20 27 28 28 22 ->item-list '(("
0d30: 61 22 20 22 61 20 62 20 63 20 64 22 29 28 22 62 a" "a b c d")("b
0d40: 22 20 22 63 20 64 20 65 22 29 28 22 63 22 20 22 " "c d e")("c" "
0d50: 22 29 28 22 64 22 29 29 29 29 0a 28 73 65 74 21 ")("d")))).(set!
0d60: 20 2a 76 65 72 62 6f 73 69 74 79 2a 20 2d 31 29 *verbosity* -1)
0d70: 0a 28 74 65 73 74 20 22 49 74 65 6d 73 20 61 73 .(test "Items as
0d80: 73 6f 63 20 65 6d 70 74 79 20 69 74 65 6d 73 22 soc empty items"
0d90: 20 27 28 29 20 20 20 28 69 74 65 6d 2d 61 73 73 '() (item-ass
0da0: 6f 63 2d 3e 69 74 65 6d 2d 6c 69 73 74 20 27 28 oc->item-list '(
0db0: 28 22 41 22 29 29 29 29 0a 28 73 65 74 21 20 2a ("A")))).(set! *
0dc0: 76 65 72 62 6f 73 69 74 79 2a 20 31 29 0a 28 74 verbosity* 1).(t
0dd0: 65 73 74 20 22 49 74 65 6d 73 20 74 61 62 6c 65 est "Items table
0de0: 22 20 22 53 45 41 53 4f 4e 22 20 28 63 61 61 64 " "SEASON" (caad
0df0: 61 72 20 28 69 74 65 6d 2d 74 61 62 6c 65 2d 3e ar (item-table->
0e00: 69 74 65 6d 2d 6c 69 73 74 20 27 28 28 22 41 4e item-list '(("AN
0e10: 49 4d 41 4c 22 20 22 45 6c 65 70 68 61 6e 74 20 IMAL" "Elephant
0e20: 4c 69 6f 6e 22 29 28 22 53 45 41 53 4f 4e 22 20 Lion")("SEASON"
0e30: 22 53 70 72 69 6e 67 20 57 69 6e 74 65 72 22 29 "Spring Winter")
0e40: 29 29 29 29 0a 28 74 65 73 74 20 22 49 74 65 6d )))).(test "Item
0e50: 73 20 74 61 62 6c 65 20 65 6d 70 74 79 20 69 74 s table empty it
0e60: 65 6d 73 20 49 22 20 27 28 29 20 28 69 74 65 6d ems I" '() (item
0e70: 2d 74 61 62 6c 65 2d 3e 69 74 65 6d 2d 6c 69 73 -table->item-lis
0e80: 74 20 27 28 28 22 41 22 29 29 29 29 0a 28 74 65 t '(("A")))).(te
0e90: 73 74 20 22 49 74 65 6d 73 20 74 61 62 6c 65 20 st "Items table
0ea0: 65 6d 70 74 79 20 69 74 65 6d 73 20 49 49 22 20 empty items II"
0eb0: 27 28 29 20 28 69 74 65 6d 2d 74 61 62 6c 65 2d '() (item-table-
0ec0: 3e 69 74 65 6d 2d 6c 69 73 74 20 27 28 28 22 41 >item-list '(("A
0ed0: 22 20 22 22 29 29 29 29 " ""))))