diff options
author | bd <bdunahu@operationnull.com> | 2024-06-27 01:25:16 -0600 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2024-06-27 01:25:16 -0600 |
commit | e07c1aae40ce1f63922a02ed30504405800cecc4 (patch) | |
tree | 2a53db581f6e933b39624db44582adb32b73aa92 /ss-generator/ss-gen-test.scm | |
parent | 03ad9b7eadb02b05e4eb5074d0fdaadf8dc4ee00 (diff) |
Add ss-generator, a simple sentence generator
Diffstat (limited to 'ss-generator/ss-gen-test.scm')
-rw-r--r-- | ss-generator/ss-gen-test.scm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ss-generator/ss-gen-test.scm b/ss-generator/ss-gen-test.scm new file mode 100644 index 0000000..b550421 --- /dev/null +++ b/ss-generator/ss-gen-test.scm @@ -0,0 +1,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") |