aful/aful/tests/test-aful-racket.rkt
2016-12-20 11:57:17 +01:00

21 lines
654 B
Racket

#lang aful racket/base
(module+ test
(require rackunit)
(check-equal? (map (+ % 1) '(1 2 3))
'(2 3 4))
(check-equal? (map (+ % %2) '(1 2 3) '(1 2 3))
'(2 4 6))
(check-equal? ((apply list* % %&) 1 '(2 3))
'(1 2 3))
(check-equal? ((* 1/2 %#:m (* %#:v %#:v)) #:m 2 #:v 1)
1)
(check-equal? (let ([x ("I am x")])
(#λx))
"I am x")
(check-equal? ((begin (set! % "%") %1) "%1")
"%")
(check-equal? (let ([lambda "not lambda"] [define-syntax "not define-syntax"])
(#λ% 3))
3)
)