|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define-module (test-suite test-eval-string) |
|
#:use-module (test-suite lib) |
|
#:use-module (ice-9 eval-string)) |
|
|
|
|
|
(with-test-prefix "basic" |
|
(pass-if "eval none" |
|
(equal? (eval-string "") *unspecified*)) |
|
|
|
(pass-if "eval single" |
|
(equal? (eval-string "'foo") 'foo)) |
|
|
|
(pass-if "eval multiple" |
|
(equal? (eval-string "'foo 'bar") 'bar)) |
|
|
|
(pass-if "compile none" |
|
(equal? (eval-string "" #:compile? #t) *unspecified*)) |
|
|
|
(pass-if "compile single" |
|
(equal? (eval-string "'foo" #:compile? #t) |
|
'foo)) |
|
|
|
(pass-if "compile multiple" |
|
(equal? (eval-string "'foo 'bar" #:compile? #t) |
|
'bar)) |
|
|
|
(pass-if "eval values" |
|
(equal? (call-with-values (lambda () |
|
(eval-string "(values 1 2)")) |
|
list) |
|
'(1 2))) |
|
|
|
(pass-if "compile values" |
|
(equal? (call-with-values (lambda () |
|
(eval-string "(values 1 2)" #:compile? #t)) |
|
list) |
|
'(1 2))) |
|
|
|
(pass-if-equal "source properties" |
|
'((filename . "test.scm") (line . 3) (column . 42)) |
|
(source-properties |
|
(eval-string "'(1 2)" #:file "test.scm" #:line 3 #:column 41)))) |
|
|