diff options
author | Stuart Sierra <mail@stuartsierra.com> | 2009-12-01 11:15:51 -0500 |
---|---|---|
committer | Chouser <chouser@n01se.net> | 2010-01-27 22:24:54 -0500 |
commit | 634b3d535a13509efca07d8cbfb7f11ff2792a76 (patch) | |
tree | a4b40e8492369248f952b790ca460d2dceeb70c6 /src | |
parent | caaa0f4c96ddf43b6bbe3d760f49701c3f183783 (diff) |
Use re-find (not re-matches) in thrown-with-msg?; fixes #204
Signed-off-by: Chouser <chouser@n01se.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/clj/clojure/test.clj | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/clj/clojure/test.clj b/src/clj/clojure/test.clj index 3d09f23e..960e580b 100644 --- a/src/clj/clojure/test.clj +++ b/src/clj/clojure/test.clj @@ -468,7 +468,7 @@ ;; (is (thrown-with-msg? c re expr)) ;; Asserts that evaluating expr throws an exception of class c. ;; Also asserts that the message string of the exception matches - ;; (with re-matches) the regular expression re. + ;; (with re-find) the regular expression re. (let [klass (nth form 1) re (nth form 2) body (nthnext form 3)] @@ -476,7 +476,7 @@ (report {:type :fail, :message ~msg, :expected '~form, :actual nil}) (catch ~klass e# (let [m# (.getMessage e#)] - (if (re-matches ~re m#) + (if (re-find ~re m#) (report {:type :pass, :message ~msg, :expected '~form, :actual e#}) (report {:type :fail, :message ~msg, @@ -512,7 +512,7 @@ (is (thrown-with-msg? c re body)) checks that an instance of c is thrown AND that the message on the exception matches (with - re-matches) the regular expression re." + re-find) the regular expression re." ([form] `(is ~form nil)) ([form msg] `(try-expr ~msg ~form))) |