diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-20 23:45:58 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-20 23:45:58 -0500 |
| commit | a5a6605877c98a37696a30d310a29f4d1fc230e9 (patch) | |
| tree | 3342f8aea7150c60bf222d428ab00a8e0bfdf8e5 /tests | |
| parent | b69553214509c606f22a984172a190d8122e70c0 (diff) | |
| download | mal-a5a6605877c98a37696a30d310a29f4d1fc230e9.tar.gz mal-a5a6605877c98a37696a30d310a29f4d1fc230e9.zip | |
Perl: add step4_if_fn_do
- Move string/printing tests to the bottom of tests/step4_if_fn_do
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/step4_if_fn_do.mal | 224 |
1 files changed, 112 insertions, 112 deletions
diff --git a/tests/step4_if_fn_do.mal b/tests/step4_if_fn_do.mal index 32d2d66..3e1c016 100644 --- a/tests/step4_if_fn_do.mal +++ b/tests/step4_if_fn_do.mal @@ -1,117 +1,5 @@ ;; ----------------------------------------------------- -;; Testing string quoting - -"" -;=>"" - -"abc" -;=>"abc" - -"abc def" -;=>"abc def" - -"\"" -;=>"\"" - - -;; Testing pr-str - -(pr-str) -;=>"" - -(pr-str "") -;=>"\"\"" - -(pr-str "abc") -;=>"\"abc\"" - -(pr-str "abc def" "ghi jkl") -;=>"\"abc def\" \"ghi jkl\"" - -(pr-str "\"") -;=>"\"\\\"\"" - -(pr-str (list 1 2 "abc" "\"") "def") -;=>"(1 2 \"abc\" \"\\\"\") \"def\"" - - -;; Testing str - -(str) -;=>"" - -(str "") -;=>"" - -(str "abc") -;=>"abc" - -(str "\"") -;=>"\"" - -(str 1 "abc" 3) -;=>"1abc3" - -(str "abc def" "ghi jkl") -;=>"abc defghi jkl" - -;;; TODO: get this working properly -;;;(str (list 1 2 "abc" "\"") "def") -;;;;=>"(1 2 \"abc\" \"\\\"\")def" - - -;; Testing prn -(prn) -; -;=>nil - -(prn "") -; "" -;=>nil - -(prn "abc") -; "abc" -;=>nil - -(prn "abc def" "ghi jkl") -; "abc def" "ghi jkl" - -(prn "\"") -; "\"" -;=>nil - -(prn (list 1 2 "abc" "\"") "def") -; (1 2 "abc" "\"") "def" -;=>nil - - -;; Testing println -(println) -; -;=>nil - -(println "") -; -;=>nil - -(println "abc") -; abc -;=>nil - -(println "abc def" "ghi jkl") -; abc def ghi jkl - -(println "\"") -; " -;=>nil - -(println (list 1 2 "abc" "\"") "def") -; (1 2 abc ") def -;=>nil - -;; ----------------------------------------------------- - ;; Testing list functions (list) @@ -328,6 +216,118 @@ a (fib 10) ;=>89 +;; ----------------------------------------------------- + +;; Testing string quoting + +"" +;=>"" + +"abc" +;=>"abc" + +"abc def" +;=>"abc def" + +"\"" +;=>"\"" + + +;; Testing pr-str + +(pr-str) +;=>"" + +(pr-str "") +;=>"\"\"" + +(pr-str "abc") +;=>"\"abc\"" + +(pr-str "abc def" "ghi jkl") +;=>"\"abc def\" \"ghi jkl\"" + +(pr-str "\"") +;=>"\"\\\"\"" + +(pr-str (list 1 2 "abc" "\"") "def") +;=>"(1 2 \"abc\" \"\\\"\") \"def\"" + + +;; Testing str + +(str) +;=>"" + +(str "") +;=>"" + +(str "abc") +;=>"abc" + +(str "\"") +;=>"\"" + +(str 1 "abc" 3) +;=>"1abc3" + +(str "abc def" "ghi jkl") +;=>"abc defghi jkl" + +;;; TODO: get this working properly +;;;(str (list 1 2 "abc" "\"") "def") +;;;;=>"(1 2 \"abc\" \"\\\"\")def" + + +;; Testing prn +(prn) +; +;=>nil + +(prn "") +; "" +;=>nil + +(prn "abc") +; "abc" +;=>nil + +(prn "abc def" "ghi jkl") +; "abc def" "ghi jkl" + +(prn "\"") +; "\"" +;=>nil + +(prn (list 1 2 "abc" "\"") "def") +; (1 2 "abc" "\"") "def" +;=>nil + + +;; Testing println +(println) +; +;=>nil + +(println "") +; +;=>nil + +(println "abc") +; abc +;=>nil + +(println "abc def" "ghi jkl") +; abc def ghi jkl + +(println "\"") +; " +;=>nil + +(println (list 1 2 "abc" "\"") "def") +; (1 2 abc ") def +;=>nil + ;; ;; -------- Optional Functionality -------- |
