mirror of
https://github.com/teo3300/rust-mal.git
synced 2026-01-12 01:05:32 +01:00
53 lines
1.0 KiB
Plaintext
53 lines
1.0 KiB
Plaintext
; This is used for assert-eq in other tests
|
|
|
|
; For each type do the following tests:
|
|
; single element
|
|
; equal elements
|
|
; 1 different
|
|
; compare with foreign type
|
|
|
|
; nil
|
|
(assert (= nil nil))
|
|
(assert (not (= nil t)))
|
|
(assert (not (= nil 1)))
|
|
|
|
; bool
|
|
(assert (= t t))
|
|
(assert (not (= nil t)))
|
|
(assert (not (= t 1)))
|
|
|
|
; int
|
|
(assert (= 1 1))
|
|
(assert (not (= 1 2)))
|
|
(assert (not (= 1 nil)))
|
|
|
|
; key
|
|
(assert (= :a :a))
|
|
(assert (not (= :a :b)))
|
|
(assert (not (= :a "a")))
|
|
|
|
; sym
|
|
(assert (= 'a 'a))
|
|
(assert (not (= 'a 'b)))
|
|
(assert (not (= 'a "a")))
|
|
|
|
; string
|
|
(assert (= "a" "a"))
|
|
(assert (not (= "a" "b")))
|
|
(assert (not (= "a" :a)))
|
|
|
|
; add comparison for same elements with different length
|
|
|
|
; list
|
|
(assert (= '(1 1 1) '(1 1 1)))
|
|
(assert (not (= '(1 2 1) '(1 1 1))))
|
|
(assert (not (= '(1) '(1 1))))
|
|
(assert (not (= '(1 1) '(1))))
|
|
(assert (not (= () '(1))))
|
|
(assert (not (= '(1) ())))
|
|
(assert (not (= '(1 1 1) [1 1 1])))
|
|
|
|
; vector
|
|
(assert (= [1 1 1] [1 1 1]))
|
|
(assert (not (= [1 2 1] [1 1 1])))
|
|
(assert (not (= [1 1 1] '(1 1 1)))) |