1
0
Fork 0
lesson-lisp/tests/equiv.scm

56 lines
1.8 KiB
Scheme
Raw Normal View History

2023-05-06 13:26:27 -04:00
(begin
(displayln "--- TEST: equal? -----------------------------------------------")
; No args
(displayln (equal?))
; A single arg
(displayln (equal? '()))
(displayln (equal? +))
(displayln (equal? (cons 123 456)))
(displayln (equal? #false))
(displayln (equal? #true))
;(displayln (equal? #\n))
(displayln (equal? 'foo))
(displayln (equal? "foo"))
(displayln (equal? 123))
; Two equal args
(displayln (equal? '() '()))
(displayln (equal? + +))
(displayln (equal? (cons 123 456) (cons 123 456)))
(displayln (equal? #false #false))
(displayln (equal? #true #true))
;(displayln (equal? #\n #\n))
(displayln (equal? 'foo 'foo))
(displayln (equal? "foo" "foo"))
(displayln (equal? 123 123))
; Two different args
(displayln (equal? '() '(1)))
(displayln (equal? + -))
(displayln (equal? (cons 123 456) (cons 123 789)))
(displayln (equal? #false #true))
(displayln (equal? #true #false))
;(displayln (equal? #\n #\t))
(displayln (equal? 'foo 'bar))
(displayln (equal? "foo" "bar"))
(displayln (equal? 123 789))
; Three equal args
(displayln (equal? '() '() '()))
(displayln (equal? + + +))
(displayln (equal? (cons 123 456) (cons 123 456) (cons 123 456)))
(displayln (equal? #false #false #false))
(displayln (equal? #true #true #true))
;(displayln (equal? #\n #\n #\n))
(displayln (equal? 'foo 'foo 'foo))
(displayln (equal? "foo" "foo" "foo"))
(displayln (equal? 123 123 123))
; Three different args
(displayln (equal? '() '() '(1)))
(displayln (equal? + + -))
(displayln (equal? (cons 123 456) (cons 123 456) (cons 123 789)))
(displayln (equal? #false #false #true))
(displayln (equal? #true #true #false))
;(displayln (equal? #\n #\n #\t))
(displayln (equal? 'foo 'foo 'bar))
(displayln (equal? "foo" "foo" "bar"))
(displayln (equal? 123 123 789))
)