Skip to content

Commit

Permalink
rm unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
erdos committed Nov 3, 2023
1 parent 117bced commit ddc1786
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
5 changes: 0 additions & 5 deletions src/stencil/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@
(defn assoc-if-val [m k v]
(if (some? v) (assoc m k v) m))

(defn suffixes [xs] (take-while seq (iterate next xs)))
(defn prefixes [xs] (take-while seq (iterate butlast xs)))

(defmacro fail [msg obj]
(assert (string? msg))
(assert (map? obj))
Expand All @@ -66,8 +63,6 @@
(number? x) (int x)
:else (fail "Unexpected type of input" {:type (:type x) :input x})))

(defn subs-last [^String s ^long n] (.substring s (- (.length s) n)))

(defn parsing-exception [expression message]
(ParsingException/fromMessage (str expression) (str message)))

Expand Down
20 changes: 0 additions & 20 deletions test/stencil/util_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@
(testing "Difference clojure core"
(is (not (zip/branch? (xml-zip 42))))))))

(deftest test-suffixes
(is (= [] (suffixes nil)))
(is (= [] (suffixes [])))
(is (= [[1]] (suffixes [1])))
(is (= [[1 2 3] [2 3] [3]] (suffixes [1 2 3]))))

(deftest test-prefixes
(is (= [] (prefixes nil)))
(is (= [] (prefixes [])))
(is (= [[1]] (prefixes [1])))
(is (= [[1 2 3] [1 2] [1]] (prefixes [1 2 3]))))

(deftest test-->int
(is (= nil (->int nil)))
(is (= 23 (->int 23)))
Expand Down Expand Up @@ -97,14 +85,6 @@
(deftest fail-test
(is (thrown? clojure.lang.ExceptionInfo (fail "test error" {}))))

(deftest prefixes-test
(is (= [] (prefixes []) (prefixes nil)))
(is (= [[1 2 3] [1 2] [1]] (prefixes [1 2 3]))))

(deftest suffixes-test
(is (= [] (suffixes []) (suffixes nil)))
(is (= [[1 2 3] [2 3] [3]] (suffixes [1 2 3]))))

(deftest whitespace?-test
(is (= true (whitespace? \space)))
(is (= true (whitespace? \tab)))
Expand Down

0 comments on commit ddc1786

Please sign in to comment.