Skip to content

Commit

Permalink
feat(tests): adding more macros tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFola committed Dec 23, 2024
1 parent b5b5858 commit 7c9e8a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/std
Submodule std updated 2 files
+28 −0 Macros.ark
+3 −1 tests/macros-tests.ark
13 changes: 12 additions & 1 deletion tests/unittests/resources/LangSuite/macro-tests.ark
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,28 @@
(test:eq (c 4 10) 40)

($ d (a b) (/ a b))
(test:eq (d 10 2) 5) })
(test:eq (d 10 2) 5)

($ e (+ 1 2 3))
($ f (* 2 2 3))
($ g (- 1 2 3))
($ h (/ 1 2 3))
(test:eq e 6)
(test:eq f 12)
(test:eq g -4)
(test:eq h (/ 1 6)) })

(test:case "node manipulation" {
($ node_tail () (tail (begin 1 2 3)))
($ length () (len (fun () 5)))
($ not_empty_node () (empty? (fun () ())))
($ empty_node () (empty? ()))
($ empty_node_bis (empty? ()))

(test:eq (length) 3)
(test:eq (not_empty_node) false)
(test:eq (empty_node) true)
(test:eq empty_node_bis true)
# because it removes the "begin"
(test:eq (node_tail) [1 2 3]) })

Expand Down

0 comments on commit 7c9e8a6

Please sign in to comment.