diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-19 15:27:19 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-19 15:27:19 -0500 |
| commit | 9af8aee63aad6031c12f2b04ba87c16cc3273077 (patch) | |
| tree | 541b26455395db9a2048a178cf372c5c71b025fc /tests/step8_macros.mal | |
| parent | b5dedee06b3a8fbec962fe23b0d474d7cf037a3d (diff) | |
| download | mal-9af8aee63aad6031c12f2b04ba87c16cc3273077.tar.gz mal-9af8aee63aad6031c12f2b04ba87c16cc3273077.zip | |
Tests: move optional features to end and print header.
Diffstat (limited to 'tests/step8_macros.mal')
| -rw-r--r-- | tests/step8_macros.mal | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/tests/step8_macros.mal b/tests/step8_macros.mal index 023c3d5..8940a89 100644 --- a/tests/step8_macros.mal +++ b/tests/step8_macros.mal @@ -7,10 +7,6 @@ ;=>(1 2 3) (cons (list 1) (list 2 3)) ;=>((1) 2 3) -(cons [1] [2 3]) -;=>([1] 2 3) -(cons 1 [2 3]) -;=>(1 2 3) ;; Testing concat function (concat) @@ -21,8 +17,6 @@ ;=>(1 2 3 4) (concat (list 1 2) (list 3 4) (list 5 6)) ;=>(1 2 3 4 5 6) -(concat [1 2] (list 3 4) [5 6]) -;=>(1 2 3 4 5 6) (concat (concat)) ;=>() @@ -33,12 +27,6 @@ ;=>6 (first '(7 8 9)) ;=>7 -(first []) -;=>nil -(first [10]) -;=>10 -(first [10 11 12]) -;=>10 ;; Testing rest function (rest '()) @@ -47,12 +35,6 @@ ;=>() (rest '(7 8 9)) ;=>(8 9) -(rest []) -;=>() -(rest [10]) -;=>() -(rest [10 11 12]) -;=>(11 12) @@ -146,7 +128,37 @@ (cond false 7 false 8 false 9) ;=>nil -;; Testing all EVAL of non-default locations +;; Testing EVAL in let* + +(let* (x (or nil "yes")) x) +;=>"yes" + +;; +;; -------- Optional Functionality -------- + +;; Testing cons, concat, first, rest with vectors + +(cons [1] [2 3]) +;=>([1] 2 3) +(cons 1 [2 3]) +;=>(1 2 3) +(concat [1 2] (list 3 4) [5 6]) +;=>(1 2 3 4 5 6) +(first []) +;=>nil +(first [10]) +;=>10 +(first [10 11 12]) +;=>10 +(rest []) +;=>() +(rest [10]) +;=>() +(rest [10 11 12]) +;=>(11 12) + +;; Testing EVAL in vector let* + (let* [x (or nil "yes")] x) ;=>"yes" |
