Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

string fns take an object, you can't pass nil #359

Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information...
commit 314aa4caa0a72ea4f5497b2ce0900aff1c48d898 1 parent 8ac69ed
@stuarthalloway stuarthalloway authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 test/clojure/test_clojure/string.clj
View
14 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]))
Please sign in to comment.
Something went wrong with that request. Please try again.