Last active
December 28, 2015 04:09
-
-
Save yamanetoshi/7440443 to your computer and use it in GitHub Desktop.
EoPL Ex.2.17 test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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