Fix for issue #4 #17

Merged
merged 2 commits into from Feb 22, 2012
View
2 src/tracker/core.clj
@@ -246,7 +246,7 @@
default-cfg))))
(defn ttname [tname]
- (let [match (re-matches #"(.*)\..*" tname)]
+ (let [match (re-matches #"(.+)\..*" tname)]
(if match
(str (match 1) "-times.csv")
(str tname "-times.csv"))))
View
5 test/tracker/test/core.clj
@@ -2,5 +2,6 @@
(:use [tracker.core])
(:use [clojure.test]))
-(deftest replace-me ;; FIXME: write
- (is false "No tests have been written."))
+(deftest ttname-test
+ (is (= ".tasks-times.csv" (ttname ".tasks")))
+ (is (= "tasks-times.csv" (ttname "tasks.txt"))))