diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/clojure/contrib/test_clojure/Reader/Reader.clj | 134 | ||||
-rw-r--r-- | src/clojure/contrib/test_clojure/test_clojure.clj | 21 |
2 files changed, 155 insertions, 0 deletions
diff --git a/src/clojure/contrib/test_clojure/Reader/Reader.clj b/src/clojure/contrib/test_clojure/Reader/Reader.clj new file mode 100644 index 00000000..7ee9b6b3 --- /dev/null +++ b/src/clojure/contrib/test_clojure/Reader/Reader.clj @@ -0,0 +1,134 @@ +;; Copyright (c) Stephen C. Gilardi. All rights reserved. The use and +;; distribution terms for this software are covered by the Common Public +;; License 1.0 (http://opensource.org/licenses/cpl.php) which can be found +;; in the file CPL.TXT at the root of this distribution. By using this +;; software in any fashion, you are agreeing to be bound by the terms of +;; this license. You must not remove this notice, or any other, from this +;; software. +;; +;; clojure.contrib.test-clojure.Reader.clj +;; +;; Tests for the Clojure functions documented at the URL: +;; +;; http://clojure.org/Reader +;; +;; scgilardi (gmail) +;; Created 22 October 2008 + +sq/clj/local/clojure/contrib/test_clojure2/ +(ns clojure.contrib.test-clojure.Reader + (:use clojure.contrib.test-is)) + +;; Symbols + +(deftest t-Symbols + (is (= 'abc (symbol "abc"))) + (is (= '*+!-_? (symbol "*+!-_?"))) + (is (= 'abc:def:ghi (symbol "abc:def:ghi"))) + (is (= 'abc/def (symbol "abc" "def"))) + (is (= 'abc.def/ghi (symbol "abc.def" "ghi"))) + (is (= 'abc/def.ghi (symbol "abc" "def.ghi"))) + (is (= 'abc:def/ghi:jkl.mno (symbol "abc:def" "ghi:jkl.mno"))) + (is (instance? clojure.lang.Symbol 'alphabet)) + ) + +;; Literals + +;; Strings + +(deftest t-Strings + (is (= "abcde" (str \a \b \c \d \e))) + (is (= "abc + def" (str \a \b \c \newline \space \space \d \e \f))) + ) + +;; Numbers + +(deftest t-Numbers) + +;; Characters + +(deftest t-Characters) + +;; nil + +(deftest t-nil) + +;; Booleans + +(deftest t-Booleans) + +;; Keywords + +(deftest t-Keywords) + +;; Lists + +(deftest t-Lists) + +;; Vectors + +(deftest t-Vectors) + +;; Maps + +(deftest t-Maps) + +;; Sets + +(deftest t-Sets) + +;; Macro characters + +;; Quote (') + +(deftest t-Quote) + +;; Character (\) + +(deftest t-Character) + +;; Comment (;) + +(deftest t-Comment) + +;; Meta (^) + +(deftest t-Meta) + +;; Deref (@) + +(deftest t-Deref) + +;; Dispatch (#) + +;; #{} - see Sets above + +;; Regex patterns (#"pattern") + +(deftest t-Regex) + +;; Metadata (#^) + +(deftest t-Metadata) + +;; Var-quote (#') + +(deftest t-Var-quote) + +;; Anonymous function literal (#()) + +(deftest t-Anonymouns-function-literal) + +;; Syntax-quote (`, note, the "backquote" character), Unquote (~) and +;; Unquote-splicing (~@) + +(deftest t-Syntax-quote) + +;; (read) +;; (read stream) +;; (read stream eof-is-error) +;; (read stream eof-is-error eof-value) +;; (read stream eof-is-error eof-value is-recursive) + +(deftest t-read) diff --git a/src/clojure/contrib/test_clojure/test_clojure.clj b/src/clojure/contrib/test_clojure/test_clojure.clj new file mode 100644 index 00000000..d7d53312 --- /dev/null +++ b/src/clojure/contrib/test_clojure/test_clojure.clj @@ -0,0 +1,21 @@ +;; Copyright (c) Stephen C. Gilardi. All rights reserved. The use and +;; distribution terms for this software are covered by the Common Public +;; License 1.0 (http://opensource.org/licenses/cpl.php) which can be found +;; in the file CPL.TXT at the root of this distribution. By using this +;; software in any fashion, you are agreeing to be bound by the terms of +;; this license. You must not remove this notice, or any other, from this +;; software. +;; +;; clojure.contrib.test-clojure +;; +;; Tests for the facilities provided by Clojure +;; +;; scgilardi (gmail) +;; Created 22 October 2008 + +(ns clojure.contrib.test-clojure + (:use (clojure.contrib test-is) + (clojure.contrib.test-clojure Reader))) + +(binding [*test-out* (java.io.PrintWriter. *out*)] + (run-tests 'clojure.contrib.test-clojure.Reader)) |