mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-17 08:27:45 +03:00
16 lines
381 B
Plaintext
16 lines
381 B
Plaintext
|
(load "Test.carp")
|
||
|
(use Test)
|
||
|
|
||
|
(def test-string @"")
|
||
|
|
||
|
(defn test-ignore-do []
|
||
|
(ignore-do (+ 2 2) ;; ignored
|
||
|
(set! test-string @"new-string") ;; ignored, but side-effect performed
|
||
|
(- 4 4)))
|
||
|
|
||
|
(deftest test
|
||
|
(assert-true test
|
||
|
(and (= () (test-ignore-do)) (= &test-string "new-string"))
|
||
|
"ignore-do performs side effects and ignores all results")
|
||
|
)
|