diff options
author | scgilardi <scgilardi@gmail.com> | 2008-11-16 17:20:48 +0000 |
---|---|---|
committer | scgilardi <scgilardi@gmail.com> | 2008-11-16 17:20:48 +0000 |
commit | 9784ebfab888a43f0d18663d39de744cf997f38a (patch) | |
tree | bbaf3d78c092f8622c5f0d2f9c86d01256345fae /src/clojure/contrib/test_clojure | |
parent | b73be8505e49ba987e33ce98a1cba9549512265e (diff) |
delete my contribs at their pre-SVN1088 locations
Diffstat (limited to 'src/clojure/contrib/test_clojure')
-rw-r--r-- | src/clojure/contrib/test_clojure/numbers/numbers.clj | 69 | ||||
-rw-r--r-- | src/clojure/contrib/test_clojure/printer/printer.clj | 81 | ||||
-rw-r--r-- | src/clojure/contrib/test_clojure/reader/reader.clj | 171 | ||||
-rw-r--r-- | src/clojure/contrib/test_clojure/test_clojure.clj | 32 |
4 files changed, 0 insertions, 353 deletions
diff --git a/src/clojure/contrib/test_clojure/numbers/numbers.clj b/src/clojure/contrib/test_clojure/numbers/numbers.clj deleted file mode 100644 index 0e5432ad..00000000 --- a/src/clojure/contrib/test_clojure/numbers/numbers.clj +++ /dev/null @@ -1,69 +0,0 @@ -;; 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.numbers -;; -;; scgilardi (gmail) -;; Created 30 October 2008 - -(ns clojure.contrib.test-clojure.numbers - (:use clojure.contrib.test-is)) - -(deftest Coerced-Byte - (let [v (byte 3)] - (is (instance? Byte v)) - (is (number? v)) - (is (integer? v)) - (is (rational? v)))) - -(deftest Coerced-Short - (let [v (short 3)] - (is (instance? Short v)) - (is (number? v)) - (is (integer? v)) - (is (rational? v)))) - -(deftest Coerced-Integer - (let [v (int 3)] - (is (instance? Integer v)) - (is (number? v)) - (is (integer? v)) - (is (rational? v)))) - -(deftest Coerced-Long - (let [v (long 3)] - (is (instance? Long v)) - (is (number? v)) - (is (integer? v)) - (is (rational? v)))) - -(deftest Coerced-BigInteger - (let [v (bigint 3)] - (is (instance? BigInteger v)) - (is (number? v)) - (is (integer? v)) - (is (rational? v)))) - -(deftest Coerced-Float - (let [v (float 3)] - (is (instance? Float v)) - (is (number? v)) - (is (float? v)))) - -(deftest Coerced-Double - (let [v (double 3)] - (is (instance? Double v)) - (is (number? v)) - (is (float? v)))) - -(deftest Coerced-BigDecimal - (let [v (bigdec 3)] - (is (instance? BigDecimal v)) - (is (number? v)) - (is (decimal? v)) - (is (not (float? v))))) diff --git a/src/clojure/contrib/test_clojure/printer/printer.clj b/src/clojure/contrib/test_clojure/printer/printer.clj deleted file mode 100644 index b5ea9b76..00000000 --- a/src/clojure/contrib/test_clojure/printer/printer.clj +++ /dev/null @@ -1,81 +0,0 @@ -;; 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.printer -;; -;; scgilardi (gmail) -;; Created 29 October 2008 - -(ns clojure.contrib.test-clojure.printer - (:use clojure.contrib.test-is)) - -(deftest print-length-empty-seq - (let [coll () val "()"] - (is (= val (binding [*print-length* 0] (print-str coll)))) - (is (= val (binding [*print-length* 1] (print-str coll)))))) - -(deftest print-length-seq - (let [coll (range 5) - length-val '((0 "(...)") - (1 "(0 ...)") - (2 "(0 1 ...)") - (3 "(0 1 2 ...)") - (4 "(0 1 2 3 ...)") - (5 "(0 1 2 3 4)"))] - (doseq [length val] length-val - (binding [*print-length* length] - (is (= val (print-str coll))))))) - -(deftest print-length-empty-vec - (let [coll [] val "[]"] - (is (= val (binding [*print-length* 0] (print-str coll)))) - (is (= val (binding [*print-length* 1] (print-str coll)))))) - -(deftest print-length-vec - (let [coll [0 1 2 3 4] - length-val '((0 "[...]") - (1 "[0 ...]") - (2 "[0 1 ...]") - (3 "[0 1 2 ...]") - (4 "[0 1 2 3 ...]") - (5 "[0 1 2 3 4]"))] - (doseq [length val] length-val - (binding [*print-length* length] - (is (= val (print-str coll))))))) - -(deftest print-level-seq - (let [coll '(0 (1 (2 (3 (4))))) - level-val '((0 "#") - (1 "(0 #)") - (2 "(0 (1 #))") - (3 "(0 (1 (2 #)))") - (4 "(0 (1 (2 (3 #))))") - (5 "(0 (1 (2 (3 (4)))))"))] - (doseq [level val] level-val - (binding [*print-level* level] - (is (= val (print-str coll))))))) - -(deftest print-level-length-coll - (let [coll '(if (member x y) (+ (first x) 3) (foo (a b c d "Baz"))) - level-length-val - '((0 1 "#") - (1 1 "(if ...)") - (1 2 "(if # ...)") - (1 3 "(if # # ...)") - (1 4 "(if # # #)") - (2 1 "(if ...)") - (2 2 "(if (member x ...) ...)") - (2 3 "(if (member x y) (+ # 3) ...)") - (3 2 "(if (member x ...) ...)") - (3 3 "(if (member x y) (+ (first x) 3) ...)") - (3 4 "(if (member x y) (+ (first x) 3) (foo (a b c d ...)))") - (3 5 "(if (member x y) (+ (first x) 3) (foo (a b c d Baz)))"))] - (doseq [level length val] level-length-val - (binding [*print-level* level - *print-length* length] - (is (= val (print-str coll))))))) diff --git a/src/clojure/contrib/test_clojure/reader/reader.clj b/src/clojure/contrib/test_clojure/reader/reader.clj deleted file mode 100644 index 3f444e27..00000000 --- a/src/clojure/contrib/test_clojure/reader/reader.clj +++ /dev/null @@ -1,171 +0,0 @@ -;; 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. -;; -;; Tests for the Clojure functions documented at the URL: -;; -;; http://clojure.org/Reader -;; -;; scgilardi (gmail) -;; Created 22 October 2008 - -(ns clojure.contrib.test-clojure.reader - (:use clojure.contrib.test-is)) - -;; Symbols - -(deftest 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 Strings - (is (= "abcde" (str \a \b \c \d \e))) - (is (= "abc - def" (str \a \b \c \newline \space \space \d \e \f))) - ) - -;; Numbers - -(deftest Numbers - - ; Read Integer - (is (instance? Integer 2147483647)) - (is (instance? Integer +1)) - (is (instance? Integer 1)) - (is (instance? Integer +0)) - (is (instance? Integer 0)) - (is (instance? Integer -0)) - (is (instance? Integer -1)) - (is (instance? Integer -2147483648)) - - ; Read BigInteger - (is (instance? BigInteger 2147483648)) - (is (instance? BigInteger -2147483649)) - - ; Read Double - (is (instance? Double +1.0)) - (is (instance? Double 1.0)) - (is (instance? Double +0.0)) - (is (instance? Double 0.0)) - (is (instance? Double -0.0)) - (is (instance? Double -1.0)) - - ; Read BigDecimal - (is (instance? BigDecimal 2147483647M)) - (is (instance? BigDecimal +1M)) - (is (instance? BigDecimal 1M)) - (is (instance? BigDecimal +0M)) - (is (instance? BigDecimal 0M)) - (is (instance? BigDecimal -0M)) - (is (instance? BigDecimal -1M)) - (is (instance? BigDecimal -2147483648M)) - (is (instance? BigDecimal +1.0M)) - (is (instance? BigDecimal 1.0M)) - (is (instance? BigDecimal +0.0M)) - (is (instance? BigDecimal 0.0M)) - (is (instance? BigDecimal -0.0M)) - (is (instance? BigDecimal -1.0M)) -) - - -;; 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 deleted file mode 100644 index 9dd23f17..00000000 --- a/src/clojure/contrib/test_clojure/test_clojure.clj +++ /dev/null @@ -1,32 +0,0 @@ -;; 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 - (:import (java.io File FilenameFilter)) - (:use clojure.contrib.test-is)) - -(def tests [:reader :printer :numbers]) - -(defn test-name - [test] - (symbol (str "clojure.contrib.test-clojure." (name test)))) - -(doseq test tests - (require (test-name test))) - -(binding [*test-out* (java.io.PrintWriter. *out*)] - (doseq test tests - (println "\n\n=====>" test) - (run-tests (test-name test)))) |