2012-10-31 96 views
0

我的问题是为什么我的预期和生成的序列不同?我不明白为什么通过视觉检查。这两个序列为什么不相等?

在雷音测试中,我比较我的函数返回一个序列GEN-地图键

(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)) 

对预期的序列。下面是测试的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))) 

这里的顺序是从雷音测试输出:

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. 

回答

1

显然:parcelid2:parcel_id2

+0

谢谢。我解决了明显的错误,并找到了第二个错误。谢谢。 – octopusgrabbus

相关问题