Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Remove mash helper function; just use doseq.

  • Loading branch information...
commit 2116d89f1887ec2807bb0680274b5d389542fa7c 1 parent 51cecf8
@technomancy technomancy authored
Showing with 3 additions and 17 deletions.
  1. +0 −10 src/clj_stacktrace/utils.clj
  2. +3 −7 test/clj_stacktrace/core_test.clj
10 src/clj_stacktrace/utils.clj
@@ -1,15 +1,5 @@
(ns clj-stacktrace.utils)
-(defn mash
- "Reduce a seq-able to a map. The given fn should return a 2-element tuple
- representing a key and value in the new map."
- [f coll]
- (reduce
- (fn [memo elem]
- (let [[k v] (f elem)]
- (assoc memo k v)))
- {} coll))
(defn re-gsub
"Simple version of re-gsub that only supports string replacements."
[^java.util.regex.Pattern regex replacement ^String string]
10 test/clj_stacktrace/core_test.clj
@@ -3,7 +3,7 @@
(:use clj-stacktrace.core)
(:use clj-stacktrace.utils))
-(def cases-data
+(def cases
[["$biz__123" "invoke" "bar.clj" 456
{:clojure true :ns "" :fn "biz"
:file "bar.clj" :line 456 :annon-fn false}]
@@ -60,13 +60,9 @@
{:java true :class "" :method "someMethod"
:file nil :line nil}]])
-(def cases
- (mash
- (fn [[c m f l p]] [(StackTraceElement. c m f l) p])
- cases-data))
(deftest test-parse-trace-elem
- (doseq [[elem parsed] cases]
+ (doseq [[class method file line parsed] cases
+ :let [elem (StackTraceElement. class method file line)]]
(is (= parsed (parse-trace-elem elem)))))
(deftest test-trim-redundant
Please sign in to comment.
Something went wrong with that request. Please try again.