diff options
author | Stuart Halloway <stu@thinkrelevance.com> | 2010-05-30 14:05:42 -0400 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2010-06-03 21:20:59 -0400 |
commit | 314aa4caa0a72ea4f5497b2ce0900aff1c48d898 (patch) | |
tree | ddd3434b921e0f028783700b6e93a6ca761c8246 | |
parent | 8ac69ede24a0c481f312008dbca8bee2bc6e1e73 (diff) |
string fns take an object, you can't pass nil #359
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
-rw-r--r-- | test/clojure/test_clojure/string.clj | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/clojure/test_clojure/string.clj b/test/clojure/test_clojure/string.clj index d1996c7c..04f76410 100644 --- a/test/clojure/test_clojure/string.clj +++ b/test/clojure/test_clojure/string.clj @@ -59,3 +59,17 @@ (deftest t-lower-case (is (= "foobar" (s/lower-case "FooBar")))) +(deftest nil-handling + (are [f args] (thrown? NullPointerException (apply f args)) + s/reverse [nil] + s/replace [nil #"foo" "bar"] + s/replace-first [nil #"foo" "bar"] + s/capitalize [nil] + s/upper-case [nil] + s/lower-case [nil] + s/split [nil #"-"] + s/split [nil #"-" 1] + s/trim [nil] + s/triml [nil] + s/trimr [nil] + s/trim-newline [nil])) |