summaryrefslogtreecommitdiff
path: root/ss-generator/ss-gen-test.scm
blob: b5504217ca7cdf1da1cd2983dd883ddb7d1e18ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
;; -*- compile-command: "guile -L . ss-gen-test.scm"; -*-
(use-modules (srfi srfi-64)
             (ss-gen))

(test-begin "harness")


(test-equal "default Noun is a list of non-terminals"
  '(Noun man ball woman table)
  (assoc 'Noun *grammer*))

(test-equal "default verb-phrase is a list of terminals"
  '(verb-phrase (Verb noun-phrase))
  (assoc 'verb-phrase *grammer*))

(test-equal "default Verb resolve to expected words"
  '(hit took saw liked)
  (rewrites 'Verb))

(test-assert "rewrites non-existent"
  (not (rewrites 'Item)))


(test-end "harness")