Thu Apr 24 12:09:13+0200 2025
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
Tests summary
((ran 4) (failed 0))
test-alist-ref
: pass(define (test-alist-ref _)
(let ((alst '((a 3) (b 2))))
(⊦= '(3) (alist-ref 'a alst))
(⊦= '(2) (alist-ref 'b alst))
(⊦= #f (alist-ref 'c alst))))
test/len
: pass(define (test/len _)
(let ((my-strlen
(foreign-lambda*
int
((scheme-object cons))
"C_return(C_header_size(cons));")))
(⊦= 2 (my-strlen (cons 1 '())))
(⊦= 2 (my-strlen (cons 1 (cons 2 (cons 3 '())))))
(⊦= 11 (my-strlen "hello world"))))
test/c-apply
: pass(define (test/c-apply _)
(let ((witness (gensym))
(my-strlen
(foreign-safe-lambda*
scheme-object
((scheme-object f))
"\t\t\t\t\t C_word res;\n\t\t\t\t\t int s = CHICKEN_apply(f, C_SCHEME_END_OF_LIST, &res);\n\t\t\t\t\t printf(\"code: %d\\n\", s);\n\t\t\t\t\t C_return (res);")))
(⊦= witness (car (my-strlen (lambda () (list witness 4)))))))
test-null-eq?
: pass(define (test-null-eq? _) (⊨ (eq? '() '())))