0

My question is why are my expected and generated sequences different? I cannot see why upon visual inspection.

In lein test, I am comparing a sequence returned by my function gen-map-keys

(defn gen-map-keys
  "Takes a sequence, and turns it into viable keys for a map.
   We opt to change spaces ' ' to dashes '-'."

  [in-seq]
  (map #(-> % cstr/trim (cstr/replace " " "-") keyword) in-seq))

against an expected sequence. Here's the sequence in the test's core.clj

(deftest test-kind-stat
  (let [existing-fnam "project.clj"
   existing-dir "test"
   non-existing-fnam "file-does-not-exist.not-exist"
   test-key-spaces1 '("COVERAGE DESCRIPTION" "BIL MO")
   test-key-spaces2 '("rectype" "parcel_id1" "parcel_id2" "parcel_id3" "house_num" alt_house_num")

   test-keys       '("key1" "key2" "key3")]

   (is (= '(:key1 :key2 :key3) (gen-map-keys test-keys)))
   (is (= '(:COVERAGE-DESCRIPTION :BILL-MO) (gen-map-keys test-key-spaces1)))
   (is (= '(:rectype :parcel_id1 :parcel_id2 :parcel_id3 :house_num :alt_house_num)            (gen-map-keys test-key-spaces2)))

Here is the output from lein test:

FAIL in (test-kind-stat) (core.clj:33)
expected: (= (quote (:COVERAGE-DESCRIPTION :BILL-MO)) (gen-map-keys test-key-spaces1))
  actual: (not (= (:COVERAGE-DESCRIPTION :BILL-MO) (:COVERAGE-DESCRIPTION :BIL-MO)))

Ran 10 tests containing 41 assertions.
1 failures, 0 errors.
octopusgrabbus
  • 10,555
  • 15
  • 68
  • 131

1 Answers1

1

Obviously :parcelid2 is not :parcel_id2?

kotarak
  • 17,099
  • 2
  • 49
  • 39