Skip to content

Instantly share code, notes, and snippets.

@yamanetoshi
Last active December 28, 2015 04:09
Show Gist options
  • Save yamanetoshi/7440443 to your computer and use it in GitHub Desktop.
Save yamanetoshi/7440443 to your computer and use it in GitHub Desktop.
EoPL Ex.2.17 test
(use gauche.test)
(add-load-path ".")
(load "env")
(test-start "has-association?")
(test-section "empty-env")
(test* "empty-env"
#f
(has-association? (empty-env) 'a))
(test* "empty-env"
(test-error)
(apply-env (empty-env) 'a))
(test-section "has-association")
(test* "env does not have value"
#f
(has-association? (extend-env '(x y) '(1 2) (empty-env)) 'a))
(test* "env does not have value"
#t
(has-association? (extend-env '(x y) '(1 2) (empty-env)) 'x))
(test-section "apply-env")
(test* "env does not have value"
(test-error)
(apply-env (extend-env '(x y) '(1 2) (empty-env)) 'a))
(test* "env does not have value"
1
(apply-env (extend-env '(x y) '(1 2) (empty-env)) 'x))
(test-end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment