From ddc1786f52c24e068f57b8367cf377b9040d0980 Mon Sep 17 00:00:00 2001 From: janos erdos Date: Fri, 3 Nov 2023 23:10:34 +0100 Subject: [PATCH] rm unused functions --- src/stencil/util.clj | 5 ----- test/stencil/util_test.clj | 20 -------------------- 2 files changed, 25 deletions(-) diff --git a/src/stencil/util.clj b/src/stencil/util.clj index 4d5634d9..8ea25404 100644 --- a/src/stencil/util.clj +++ b/src/stencil/util.clj @@ -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)) @@ -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))) diff --git a/test/stencil/util_test.clj b/test/stencil/util_test.clj index 853b59af..c95d910a 100644 --- a/test/stencil/util_test.clj +++ b/test/stencil/util_test.clj @@ -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))) @@ -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)))