Hi Guys,

I'm just starting with Clojure (finished reading Programming Clojure, from
PragProg).
I mean may question should be really newbie, but I'm still confused about
all functional stuff...

I have this test code:

(def subdb-test-data {:dexter    {:path "fixtures/dexter.mp4",    :hash
"ffd8d4aa68033dc03d1c8ef373b9028c"}
                      :justified {:path "fixtures/justified.mp4", :hash
"edc1981d6459c6111fe36205b4aff6c2"}})

(deftest test-compute-hash
  (let [{:keys [path hash]} (subdb-test-data :dexter)]
    (is (= hash (subdb-hash path)) "hash don't match")))

It's currently testing only the first video, on test-data I have the video
path and the expected hash, and the test should check if hash is being
generated correctly.
My problem is, I wanna do somekind of loop and test each entry on test-data,
all in one, I tried some (for) loops but it made the test run no assertion
at all... This is my (for) trial (don't works):

(deftest test-compute-hash
  (for [{:keys [path hash]} (vals subdb-test-data)]
    (is (= hash (subdb-hash path)) "hash don't match")))

How I can make this works? I will need to create a macro for that (I hope
not...)?
---
Wilker LĂșcio
http://about.me/wilkerlucio/bio
Kajabi Consultant
+55 81 82556600

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to