summaryrefslogtreecommitdiff
path: root/test/res/test.lisp
blob: 79d259d9d76f958f6b8596dd12a0a8f3e273154a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
(debuglog "Hello, World, here is an atom:" :iamanatom)
(defun myfun (var) (debuglog var)) 
(myfun :myfunworks)
((lambda (a) (debuglog a)) :atom)
(defun testlog (a ...) (seq
    (debuglog "a" a)
    (debuglog "..." ...)))
(testlog :test :work :whatever)
(def helloworld (pure "hello world"))
(debuglog helloworld (helloworld))
(debuglog "+" (+ 1.2 15))
(debuglog "-" (- 1 3))
(debuglog "*" (* 10 10))
(debuglog "/" (/ 1 3 2))
(debuglog "============")
(defun testsomething (c) (debuglog (if! c (seq (debuglog "left evaluated") (return "truthy value")) "falsey value")))
(testsomething true)
(testsomething false)
(noop)
(debuglog "============")
(debuglog "This should fail" sc)
(import :secondary)
(debuglog "This should work" sc)

(debuglog "============")
(debuglog "Running tests")
(import :test)
(test.test "Funny test" (seq
    (debuglog "Funny test running")
    ((test.assert false "False failed"))
    ((test.assert-eq "funny" "unfunny"))
    ((test.fail "Test failed"))))

(test.test "Test equality" (seq
    ((test.assert-eq false false))
    ((test.assert-eq (not false) true))
    ((test.assert-eq (not true) false))
    ((test.assert-eq (& true true) true))
    ((test.assert-eq (& true false) false))
    ((test.assert-eq (& false true) false))
    ((test.assert-eq (& false false) false))))