diff options
-rw-r--r-- | modules/complete/pom.xml | 5 | ||||
-rw-r--r-- | modules/mock/src/main/clojure/clojure/contrib/mock.clj | 2 | ||||
-rw-r--r-- | modules/test-is/pom.xml | 16 | ||||
-rw-r--r-- | modules/test-is/src/main/clojure/clojure/contrib/test_is.clj | 119 | ||||
-rw-r--r-- | pom.xml | 1 |
5 files changed, 1 insertions, 142 deletions
diff --git a/modules/complete/pom.xml b/modules/complete/pom.xml index 3151d6be..6fdbb64e 100644 --- a/modules/complete/pom.xml +++ b/modules/complete/pom.xml @@ -357,11 +357,6 @@ </dependency> <dependency> <groupId>org.clojure.contrib</groupId> - <artifactId>test-is</artifactId> - <version>1.3.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.clojure.contrib</groupId> <artifactId>trace</artifactId> <version>1.3.0-SNAPSHOT</version> </dependency> diff --git a/modules/mock/src/main/clojure/clojure/contrib/mock.clj b/modules/mock/src/main/clojure/clojure/contrib/mock.clj index 4953cd94..6f923a5d 100644 --- a/modules/mock/src/main/clojure/clojure/contrib/mock.clj +++ b/modules/mock/src/main/clojure/clojure/contrib/mock.clj @@ -41,7 +41,7 @@ ;; an error condition function is called with the name of the function ;; being mocked, the expected form and the actual value. These ;; error functions can be overridden to allow easy integration into - ;; test frameworks such as test-is by reporting errors in the function + ;; test frameworks such as clojure.test by reporting errors in the function ;; overrides. ) ;; end comment diff --git a/modules/test-is/pom.xml b/modules/test-is/pom.xml deleted file mode 100644 index c0fb8a47..00000000 --- a/modules/test-is/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 - http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.clojure.contrib</groupId> - <artifactId>parent</artifactId> - <version>1.3.0-SNAPSHOT</version> - <relativePath>../parent</relativePath> - </parent> - <artifactId>test-is</artifactId> - <dependencies> - </dependencies> -</project>
\ No newline at end of file diff --git a/modules/test-is/src/main/clojure/clojure/contrib/test_is.clj b/modules/test-is/src/main/clojure/clojure/contrib/test_is.clj deleted file mode 100644 index a1b0d8f9..00000000 --- a/modules/test-is/src/main/clojure/clojure/contrib/test_is.clj +++ /dev/null @@ -1,119 +0,0 @@ -;;; test_is.clj: Compatibility layer for old clojure.contrib.test-is - -;; by Stuart Sierra, http://stuartsierra.com/ -;; August 28, 2009 - -;; Copyright (c) Stuart Sierra, 2009. All rights reserved. The use -;; and distribution terms for this software are covered by the Eclipse -;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) -;; which can be found in the file epl-v10.html 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. - -;; DEPRECATED in 1.2: Moved to clojure.test - -(ns ^{:deprecated "1.2" - :doc "Backwards-compatibility for clojure.contrib.test-is - - The clojure.contrib.test-is library moved from Contrib into the - Clojure distribution as clojure.test. - - This happened on or around clojure-contrib Git commit - 82cf0409d0fcb71be477ebfc4da18ee2128a2ad1 on June 25, 2009. - - This file makes the clojure.test interface available under the old - namespace clojure.contrib.test-is. - - This includes support for the old syntax of the 'are' macro. - - This was suggested by Howard Lewis Ship in ticket #26, - http://www.assembla.com/spaces/clojure-contrib/tickets/26" - :author "Stuart Sierra"} - clojure.contrib.test-is - (:require clojure.test - [clojure.walk :as walk])) - - -;;; COPY INTERNED VARS (EXCEPT are) FROM clojure.test - -(doseq [v (disj (set (vals (ns-interns 'clojure.test))) - #'clojure.test/are)] - (intern *ns* (with-meta (:name (meta v)) (meta v)) (var-get v))) - - -;;; REDEFINE OLD clojure.contrib.template - -(defn find-symbols - "Recursively finds all symbols in form." - [form] - (distinct (filter symbol? (tree-seq coll? seq form)))) - -(defn find-holes - "Recursively finds all symbols starting with _ in form." - [form] - (sort (distinct (filter #(.startsWith (name %) "_") - (find-symbols form))))) - -(defn find-pure-exprs - "Recursively finds all sub-expressions in form that do not contain - any symbols starting with _" - [form] - (filter #(and (list? %) - (empty? (find-holes %))) - (tree-seq seq? seq form))) - -(defn flatten-map - "Transforms a map into a vector like [key value key value]." - [m] - (reduce (fn [coll [k v]] (conj coll k v)) - [] m)) - -(defn template? - "Returns true if form is a valid template expression." - [form] - (if (seq (find-holes form)) true false)) - -(defn apply-template - "Replaces _1, _2, _3, etc. in expr with corresponding elements of - values. Returns the modified expression. For use in macros." - [expr values] - (when-not (template? expr) - (throw (IllegalArgumentException. (str (pr-str expr) " is not a valid template.")))) - (let [expr (walk/postwalk-replace {'_ '_1} expr) - holes (find-holes expr) - smap (zipmap holes values)] - (walk/prewalk-replace smap expr))) - -(defmacro do-template - "Repeatedly evaluates template expr (in a do block) using values in - args. args are grouped by the number of holes in the template. - Example: (do-template (check _1 _2) :a :b :c :d) - expands to (do (check :a :b) (check :c :d))" - [expr & args] - (when-not (template? expr) - (throw (IllegalArgumentException. (str (pr-str expr) " is not a valid template.")))) - (let [expr (walk/postwalk-replace {'_ '_1} expr) - argcount (count (find-holes expr))] - `(do ~@(map (fn [a] (apply-template expr a)) - (partition argcount args))))) - - - -;;; REDEFINE are MACRO TO MATCH OLD TEMPLATE BEHAVIOR - -(defmacro are - "Checks multiple assertions with a template expression. - See clojure.contrib.template/do-template for an explanation of - templates. - - Example: (are (= _1 _2) - 2 (+ 1 1) - 4 (* 2 2)) - Expands to: - (do (is (= 2 (+ 1 1))) - (is (= 4 (* 2 2)))) - - Note: This breaks some reporting features, such as line numbers." - [expr & args] - `(do-template (is ~expr) ~@args)) @@ -86,7 +86,6 @@ <module>modules/string</module> <module>modules/strint</module> <module>modules/swing-utils</module> - <module>modules/test-is</module> <module>modules/trace</module> <module>modules/types</module> <module>modules/with-ns</module> |