edeposit/edeposit#454 doplnil jsem unittesty. 8 testu, 56asertions. Viz travis-ci.org

--- test/edeposit/amqp/kramerius/handlers_test.clj
+++ test/edeposit/amqp/kramerius/handlers_test.clj
@@ -12,229 +12,229 @@
             )
   )

-;; (deftest with-tmpdir-test
-;;   (testing "add tmpdir to request"
-;;     (let [payload (slurp "resources/export-request.json")
-;;           [[metadata payload] tmpdir] (-> [:no-metadata payload]
-;;                                           h/request-with-tmpdir)
-;;           ]
-;;       (is (.exists tmpdir))
-;;       (is (= metadata :no-metadata))
-;;       (is (= payload (slurp "resources/export-request.json")))
-;;       (fs/delete-dir tmpdir)
-;;       )
-;;     )
-;;   )
-
-;; (deftest save-request-test
-;;   (testing "save request payload"
-;;     (let [payload (slurp "resources/export-request.json")
-;;           tmpdir (fs/temp-dir "test-export-to-kramerius-request-")
-;;           result (-> [[:no-metadata payload] tmpdir]
-;;                      h/save-request )
-;;           ]
-;;       (is (.exists tmpdir))
-;;       (is (= tmpdir result))
-;;       (is (.exists (io/file tmpdir "payload.bin")))
-;;       (is (.exists (io/file tmpdir "metadata.clj")))
-
-;;       (is (.exists (io/file tmpdir "payload")))
-;;       (is (.exists (io/file tmpdir "payload" "uuid")))
-;;       (is (.exists (io/file tmpdir "payload" "urnnbn")))
-;;       (is (.exists (io/file tmpdir "payload" "location-at-kramerius")))
-;;       (is (.exists (io/file tmpdir "payload" "is-private")))
-;;       (is (.exists (io/file tmpdir "payload" "oai_marc.xml")))
-;;       (is (.exists (io/file tmpdir "payload" "oai_marc.xml.b64")))
-
-;;       (is (.exists (io/file tmpdir "payload" "first-page")))
-;;       (is (.exists (io/file tmpdir "payload" "first-page" "robotandbaby_001.jp2")))
-;;       (is (.exists (io/file tmpdir "payload" "first-page" "mimetype")))
-;;       (is (.exists (io/file tmpdir "payload" "first-page" "filename")))
-
-;;       (is (.exists (io/file tmpdir "payload" "original")))
-;;       (is (.exists (io/file tmpdir "payload" "original" "storage_path")))
-;;       (is (.exists (io/file tmpdir "payload" "original" "mimetype")))
-;;       (is (.exists (io/file tmpdir "payload" "original" "filename")))
-
-;;       (is (= (fs/size (io/file tmpdir "payload" "oai_marc.xml"))
-;;              (fs/size (io/file "resources" "oai_marc.xml"))))
-
-;;       (is (= "e65d9072-2c9b-11e5-99fd-b8763f0a3d61"
-;;              (slurp (io/file tmpdir "payload" "uuid"))))
-
-;;       (is (= "urn:nbn:cz:mzk-0005ol"
-;;              (slurp (io/file tmpdir "payload" "urnnbn"))))
-
-;;       (is (= "/monografie/2001/John McCarthy/Robot and Baby"
-;;              (slurp (io/file tmpdir "payload" "location-at-kramerius"))))
+(deftest with-tmpdir-test
+  (testing "add tmpdir to request"
+    (let [payload (slurp "resources/export-request.json")
+          [[metadata payload] tmpdir] (-> [:no-metadata payload]
+                                          h/request-with-tmpdir)
+          ]
+      (is (.exists tmpdir))
+      (is (= metadata :no-metadata))
+      (is (= payload (slurp "resources/export-request.json")))
+      (fs/delete-dir tmpdir)
+      )
+    )
+  )
+
+(deftest save-request-test
+  (testing "save request payload"
+    (let [payload (slurp "resources/export-request.json")
+          tmpdir (fs/temp-dir "test-export-to-kramerius-request-")
+          result (-> [[:no-metadata payload] tmpdir]
+                     h/save-request )
+          ]
+      (is (.exists tmpdir))
+      (is (= tmpdir result))
+      (is (.exists (io/file tmpdir "payload.bin")))
+      (is (.exists (io/file tmpdir "metadata.clj")))
+
+      (is (.exists (io/file tmpdir "payload")))
+      (is (.exists (io/file tmpdir "payload" "uuid")))
+      (is (.exists (io/file tmpdir "payload" "urnnbn")))
+      (is (.exists (io/file tmpdir "payload" "location-at-kramerius")))
+      (is (.exists (io/file tmpdir "payload" "is-private")))
+      (is (.exists (io/file tmpdir "payload" "oai_marc.xml")))
+      (is (.exists (io/file tmpdir "payload" "oai_marc.xml.b64")))
+
+      (is (.exists (io/file tmpdir "payload" "first-page")))
+      (is (.exists (io/file tmpdir "payload" "first-page" "robotandbaby_001.jp2")))
+      (is (.exists (io/file tmpdir "payload" "first-page" "mimetype")))
+      (is (.exists (io/file tmpdir "payload" "first-page" "filename")))
+
+      (is (.exists (io/file tmpdir "payload" "original")))
+      (is (.exists (io/file tmpdir "payload" "original" "storage_path")))
+      (is (.exists (io/file tmpdir "payload" "original" "mimetype")))
+      (is (.exists (io/file tmpdir "payload" "original" "filename")))
+
+      (is (= (fs/size (io/file tmpdir "payload" "oai_marc.xml"))
+             (fs/size (io/file "resources" "oai_marc.xml"))))
+
+      (is (= "e65d9072-2c9b-11e5-99fd-b8763f0a3d61"
+             (slurp (io/file tmpdir "payload" "uuid"))))
+
+      (is (= "urn:nbn:cz:mzk-0005ol"
+             (slurp (io/file tmpdir "payload" "urnnbn"))))
+
+      (is (= "/monografie/2001/John McCarthy/Robot and Baby"
+             (slurp (io/file tmpdir "payload" "location-at-kramerius"))))

-;;       (is (= "robotandbaby_001.jp2"
-;;              (slurp (io/file tmpdir "payload" "first-page" "filename"))))
-
-;;       (is (= "image/jp2"
-;;              (slurp (io/file tmpdir "payload" "first-page" "mimetype"))))
-;;       (fs/delete-dir tmpdir)
-;;       )
-;;     )
-;;   )
-
-;; (deftest prepare-marcxml2mods-request
-;;   (testing "prepare marcxml2mods request"
-;;     (let [payload (slurp "resources/export-request.json")
-;;           tmpdir (fs/temp-dir "test-export-to-kramerius-request-")
-;;           ]
-;;       (h/save-request [[:no-metadata payload] tmpdir])
-;;       (let [[headers {:keys [:marc_xml :uuid]}] (-> tmpdir
-;;                                                     h/prepare-marcxml2mods-request)
-;;             ]
-;;         (is (= "e65d9072-2c9b-11e5-99fd-b8763f0a3d61" uuid))
-;;         (is (.exists (io/file tmpdir "marcxml2mods")))
-;;         (is (= (.toString tmpdir) (-> headers :uuid))))
-;;       (fs/delete-dir tmpdir)
-;;       )
-;;     )
-;;   )
-
-;; (deftest save-marcxml2mods-response-test
-;;    (testing "save marcxml2mods response test"
-;;      (let [payload (slurp "resources/export-request.json")
-;;            tmpdir (fs/temp-dir "test-export-to-kramerius-request-")
-;;            ]
-
-;;        (h/save-request [[:no-metadata payload] tmpdir])
-;;        (h/prepare-marcxml2mods-request tmpdir)
-
-;;        (let [ metadata (-> (slurp "resources/marcxml2mods-response-metadata.clj")
-;;                            read-string
-;;                            (update-in [:headers] assoc "UUID" (.toString tmpdir)))
-;;              payload (slurp "resources/marcxml2mods-response-payload.json")
-;;              [mods_files response-dir] (-> [metadata payload]
-;;                                            h/save-marcxml2mods-response)
-;;              ]
-;;          (is (= tmpdir response-dir))
-;;          (is (.exists (io/file response-dir "marcxml2mods" "response")))
-;;          (is (.exists (io/file response-dir "marcxml2mods" "response" "payload.bin")))
-;;          (is (.exists (io/file response-dir "marcxml2mods" "response" "metadata.clj")))
-;;          (is (= 1 (count mods_files)))
-;;          (is (re-find #"<?xml version=" (-> mods_files (nth 0))))
-;;          )
-;;        (fs/delete-dir tmpdir)
-;;        )
-;;      )
-;;    )
-
-;; (deftest parse-mods-files-test
-;;   (testing "parse mods files test"
-;;     (let [payload (slurp "resources/export-request.json")
-;;            tmpdir (fs/temp-dir "test-export-to-kramerius-request-")
-;;            ]
-;;       (h/save-request [[:no-metadata payload] tmpdir])
-;;       (h/prepare-marcxml2mods-request tmpdir)
-;;       (let [ metadata (-> (slurp "resources/marcxml2mods-response-metadata.clj")
-;;                            read-string
-;;                            (update-in [:headers] assoc "UUID" (.toString tmpdir)))
-;;              payload (slurp "resources/marcxml2mods-response-payload.json")
-;;              [mods response-dir] (-> [metadata payload]
-;;                                            h/save-marcxml2mods-response
-;;                                            h/parse-mods-files
-;;                                            )
-;;              ]
-;;         (is (= tmpdir response-dir))
-;;         (isa? vector mods)
-;;         (is (= (count mods) 1))
-
-;;         (doseq [root mods]
-;;           (is (.contains (u/emit root) "<mods"))
-;;           (is (= :mods (:tag root)))
-;;           (is (= {:xmlns:xsi "http://www.w3.org/2001/XMLSchema-instance",
-;;                   :xmlns:xlink "http://www.w3.org/1999/xlink",
-;;                   :xmlns "http://www.loc.gov/mods/v3",
-;;                   :version "3.4",
-;;                   :ID "MODS_VOLUME_0001",
-;;                   :xsi:schemaLocation "http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema.xsd http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd http://www.w3.org/1999/xlink http://www.w3.org/1999/xlink.xsd"} (:attrs root)))
-;;           )
-
-;;         (doseq [loc (map zip/xml-zip mods)]
-;;           (is (= "Umění programování v UNIXu"
-;;                  (zx/xml1-> loc :titleInfo :title zx/text)))
-;;           (is (=  "Raymond, Eric S."
-;;                   (zx/xml1-> loc :name :namePart zx/text))))
-
-;;         )
-;;       (fs/delete-dir tmpdir)
-;;       )
-;;     )
-;;   )
-
-;; (deftest add-urnnbn-to-mods-test
-;;   (testing "add urnnbn to mods test"
-;;     (let  [payload (slurp "resources/export-request.json")
-;;            tmpdir (fs/temp-dir "test-export-to-kramerius-request-")
-;;            ]
-;;       (h/save-request [[:no-metadata payload] tmpdir])
-;;       (h/prepare-marcxml2mods-request tmpdir)
-;;       (let [ metadata (-> (slurp "resources/marcxml2mods-response-metadata.clj")
-;;                           read-string
-;;                           (update-in [:headers] assoc "UUID" (.toString tmpdir)))
-;;             payload (slurp "resources/marcxml2mods-response-payload.json")
-;;             [mods response-dir] (-> [metadata payload]
-;;                                     h/save-marcxml2mods-response
-;;                                     h/parse-mods-files
-;;                                     h/add-urnnbn-to-mods
-;;                                     )
-;;             ]
-;;         (is (= tmpdir response-dir))
-;;         (isa? vector mods)
-;;         (is (= (count mods) 1))
-;;         (doseq [root (map zip/xml-zip mods)]
-;;           (is (=  (set (zx/xml-> root :identifier zx/text))
-;;                   #{"urn:nbn:cz:mzk-0005ol" "asd" "cnb001492461" "80-251-0225-4 (brož.)" "85131856"}))
-;;           )
-;;         )
-;;       (fs/delete-dir tmpdir)
-;;       )
-;;     )
-;;   )
-
-;; (deftest mods->dc-test
-;;    (testing "transformation MODS -> OAI DC"
-;;      (def payload (slurp "resources/export-request.json"))
-;;      (def tmpdir (fs/temp-dir "test-export-to-kramerius-request-"))
-
-;;      (h/save-request  [[nil payload] tmpdir])
-
-;;      (let [ metadata (read-string (slurp "resources/marcxml2mods-response-metadata.clj"))
-;;            payload (slurp "resources/marcxml2mods-response-payload.json")
-;;            actual-metadata (-> metadata (assoc :headers
-;;                                                (-> metadata :headers (assoc "UUID" (.toString tmpdir)))))
+      (is (= "robotandbaby_001.jp2"
+             (slurp (io/file tmpdir "payload" "first-page" "filename"))))
+
+      (is (= "image/jp2"
+             (slurp (io/file tmpdir "payload" "first-page" "mimetype"))))
+      (fs/delete-dir tmpdir)
+      )
+    )
+  )
+
+(deftest prepare-marcxml2mods-request
+  (testing "prepare marcxml2mods request"
+    (let [payload (slurp "resources/export-request.json")
+          tmpdir (fs/temp-dir "test-export-to-kramerius-request-")
+          ]
+      (h/save-request [[:no-metadata payload] tmpdir])
+      (let [[headers {:keys [:marc_xml :uuid]}] (-> tmpdir
+                                                    h/prepare-marcxml2mods-request)
+            ]
+        (is (= "e65d9072-2c9b-11e5-99fd-b8763f0a3d61" uuid))
+        (is (.exists (io/file tmpdir "marcxml2mods")))
+        (is (= (.toString tmpdir) (-> headers :uuid))))
+      (fs/delete-dir tmpdir)
+      )
+    )
+  )
+
+(deftest save-marcxml2mods-response-test
+   (testing "save marcxml2mods response test"
+     (let [payload (slurp "resources/export-request.json")
+           tmpdir (fs/temp-dir "test-export-to-kramerius-request-")
+           ]
+
+       (h/save-request [[:no-metadata payload] tmpdir])
+       (h/prepare-marcxml2mods-request tmpdir)
+
+       (let [ metadata (-> (slurp "resources/marcxml2mods-response-metadata.clj")
+                           read-string
+                           (update-in [:headers] assoc "UUID" (.toString tmpdir)))
+             payload (slurp "resources/marcxml2mods-response-payload.json")
+             [mods_files response-dir] (-> [metadata payload]
+                                           h/save-marcxml2mods-response)
+             ]
+         (is (= tmpdir response-dir))
+         (is (.exists (io/file response-dir "marcxml2mods" "response")))
+         (is (.exists (io/file response-dir "marcxml2mods" "response" "payload.bin")))
+         (is (.exists (io/file response-dir "marcxml2mods" "response" "metadata.clj")))
+         (is (= 1 (count mods_files)))
+         (is (re-find #"<?xml version=" (-> mods_files (nth 0))))
+         )
+       (fs/delete-dir tmpdir)
+       )
+     )
+   )
+
+(deftest parse-mods-files-test
+  (testing "parse mods files test"
+    (let [payload (slurp "resources/export-request.json")
+           tmpdir (fs/temp-dir "test-export-to-kramerius-request-")
+           ]
+      (h/save-request [[:no-metadata payload] tmpdir])
+      (h/prepare-marcxml2mods-request tmpdir)
+      (let [ metadata (-> (slurp "resources/marcxml2mods-response-metadata.clj")
+                           read-string
+                           (update-in [:headers] assoc "UUID" (.toString tmpdir)))
+             payload (slurp "resources/marcxml2mods-response-payload.json")
+             [mods response-dir] (-> [metadata payload]
+                                           h/save-marcxml2mods-response
+                                           h/parse-mods-files
+                                           )
+             ]
+        (is (= tmpdir response-dir))
+        (isa? vector mods)
+        (is (= (count mods) 1))
+
+        (doseq [root mods]
+          (is (.contains (u/emit root) "<mods"))
+          (is (= :mods (:tag root)))
+          (is (= {:xmlns:xsi "http://www.w3.org/2001/XMLSchema-instance",
+                  :xmlns:xlink "http://www.w3.org/1999/xlink",
+                  :xmlns "http://www.loc.gov/mods/v3",
+                  :version "3.4",
+                  :ID "MODS_VOLUME_0001",
+                  :xsi:schemaLocation "http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema.xsd http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd http://www.w3.org/1999/xlink http://www.w3.org/1999/xlink.xsd"} (:attrs root)))
+          )
+
+        (doseq [loc (map zip/xml-zip mods)]
+          (is (= "Umění programování v UNIXu"
+                 (zx/xml1-> loc :titleInfo :title zx/text)))
+          (is (=  "Raymond, Eric S."
+                  (zx/xml1-> loc :name :namePart zx/text))))
+
+        )
+      (fs/delete-dir tmpdir)
+      )
+    )
+  )
+
+(deftest add-urnnbn-to-mods-test
+  (testing "add urnnbn to mods test"
+    (let  [payload (slurp "resources/export-request.json")
+           tmpdir (fs/temp-dir "test-export-to-kramerius-request-")
+           ]
+      (h/save-request [[:no-metadata payload] tmpdir])
+      (h/prepare-marcxml2mods-request tmpdir)
+      (let [ metadata (-> (slurp "resources/marcxml2mods-response-metadata.clj")
+                          read-string
+                          (update-in [:headers] assoc "UUID" (.toString tmpdir)))
+            payload (slurp "resources/marcxml2mods-response-payload.json")
+            [mods response-dir] (-> [metadata payload]
+                                    h/save-marcxml2mods-response
+                                    h/parse-mods-files
+                                    h/add-urnnbn-to-mods
+                                    )
+            ]
+        (is (= tmpdir response-dir))
+        (isa? vector mods)
+        (is (= (count mods) 1))
+        (doseq [root (map zip/xml-zip mods)]
+          (is (=  (set (zx/xml-> root :identifier zx/text))
+                  #{"urn:nbn:cz:mzk-0005ol" "asd" "cnb001492461" "80-251-0225-4 (brož.)" "85131856"}))
+          )
+        )
+      (fs/delete-dir tmpdir)
+      )
+    )
+  )
+
+(deftest mods->dc-test
+   (testing "transformation MODS -> OAI DC"
+     (def payload (slurp "resources/export-request.json"))
+     (def tmpdir (fs/temp-dir "test-export-to-kramerius-request-"))
+
+     (h/save-request  [[nil payload] tmpdir])
+
+     (let [ metadata (read-string (slurp "resources/marcxml2mods-response-metadata.clj"))
+           payload (slurp "resources/marcxml2mods-response-payload.json")
+           actual-metadata (-> metadata (assoc :headers
+                                               (-> metadata :headers (assoc "UUID" (.toString tmpdir)))))

-;;            [oai_dcs response-tmpdir] (-> (h/save-marcxml2mods-response [actual-metadata payload])
-;;                                          h/parse-mods-files
-;;                                          h/add-urnnbn-to-mods
-;;                                          h/mods->oai_dcs
-;;                                          )
-;;            ]
-
-;;        (is (= response-tmpdir tmpdir))
-
-;;        (isa? vector oai_dcs)
-;;        (is (= (count oai_dcs) 1))
-;;        (let [[root] oai_dcs]
-;;          (is (contains? root :tag))
-;;          (is (contains? root :attrs))
-;;          (is (contains? root :content))
-;;          (let [loc (-> root zip/xml-zip)]
-;;            (is (= (zx/xml1-> loc :dc:title zx/text) "Umění programování v UNIXu"))
-;;            (is (= (zx/xml1-> loc :dc:date zx/text) "2004"))
-;;            (is (=  (set (zx/xml-> loc :dc:identifier zx/text))
-;;                  #{"urnnbn:urn:nbn:cz:mzk-0005ol" "uuid:asd" "ccnb:cnb001492461"
-;;                    "isbn:80-251-0225-4 (brož.)" "oclc:85131856"}))
-;;            )
-;;          )
-;;        (fs/delete-dir tmpdir)
-;;        )
-;;      )
-;;    )
+           [oai_dcs response-tmpdir] (-> (h/save-marcxml2mods-response [actual-metadata payload])
+                                         h/parse-mods-files
+                                         h/add-urnnbn-to-mods
+                                         h/mods->oai_dcs
+                                         )
+           ]
+
+       (is (= response-tmpdir tmpdir))
+
+       (isa? vector oai_dcs)
+       (is (= (count oai_dcs) 1))
+       (let [[root] oai_dcs]
+         (is (contains? root :tag))
+         (is (contains? root :attrs))
+         (is (contains? root :content))
+         (let [loc (-> root zip/xml-zip)]
+           (is (= (zx/xml1-> loc :dc:title zx/text) "Umění programování v UNIXu"))
+           (is (= (zx/xml1-> loc :dc:date zx/text) "2004"))
+           (is (=  (set (zx/xml-> loc :dc:identifier zx/text))
+                 #{"urnnbn:urn:nbn:cz:mzk-0005ol" "uuid:asd" "ccnb:cnb001492461"
+                   "isbn:80-251-0225-4 (brož.)" "oclc:85131856"}))
+           )
+         )
+       (fs/delete-dir tmpdir)
+       )
+     )
+   )

 (deftest foxml-test
@@ -288,7 +288,7 @@
             )
           )
         )
-      ;(fs/delete-dir tmpdir)
+      (fs/delete-dir tmpdir)
       )
     )
   )


Pass concurrent.

Pass concurrent.

--- test/onyx/coordinator/concurrent_task_test.clj
+++ test/onyx/coordinator/concurrent_task_test.clj
@@ -14,6 +14,7 @@
     (fn [coordinator sync log]
       (let [n 4
             peers (take n (repeatedly (fn [] (extensions/create sync :peer))))
+            pulses (take n (repeatedly (fn [] (extensions/create sync :pulse))))
             payloads (take n (repeatedly (fn [] (extensions/create sync :payload))))
             sync-spies (take n (repeatedly (fn [] (chan 1))))

@@ -41,8 +42,8 @@
         (tap (:offer-mult coordinator) offer-ch-spy)
         (tap (:ack-mult coordinator) ack-ch-spy)

-        (doseq [[peer payload sync-spy] (map vector peers payloads sync-spies)]
-          (extensions/write-place sync peer payload)
+        (doseq [[peer pulse payload sync-spy] (map vector peers pulses payloads sync-spies)]
+          (extensions/write-place sync peer {:pulse pulse :payload payload})
           (extensions/on-change sync payload #(>!! sync-spy %)))

         (doseq [peer peers]


remove println leftover

remove println leftover

--- src/status_im/ui/screens/home/views/inner_item.cljs
+++ src/status_im/ui/screens/home/views/inner_item.cljs
@@ -56,7 +56,6 @@
 (defn render-subheader
   "Render the preview of a last message to a maximum of max-subheader-length characters"
   [parsed-text]
-  (println "PARSED" parsed-text)
   (let [result
         (reduce
          (fn [{:keys [_ length] :as acc-text} new-text-chunk]


Add self-assertions for nested defs and context states

--- src/test/clojure/com/stuartsierra/lazytest_test.clj
+++ src/test/clojure/com/stuartsierra/lazytest_test.clj
@@ -1,6 +1,8 @@
 (ns com.stuartsierra.lazytest-test
   (:use com.stuartsierra.lazytest
         com.stuartsierra.lazytest.report))
+
+;;; Basics

 (spec simple-asserts
       (is (= 2 (+ 1 1))
@@ -26,20 +28,35 @@
 (assert (success? (first (:children (simple-suite)))))
 (assert (not (success? (second (:children (simple-suite))))))

+;;; Nested definitions
+
+(spec top-level
+      (spec first-child
+            (is (= 1 1)))
+      (spec second-child
+            (is (= 2 1))))
+
+(assert (not (success? (top-level))))
+(assert (success? (first (:children (top-level)))))
+(assert (success? (first-child)))
+(assert (not (success? (second-child))))
+
+;;; Contexts
+
 (declare *log*)

 (defcontext c1 []
   (swap! *log* conj :open-c1)
   1
   :after [s]
-;; (assert (= s 1))
+  (assert (= s 1))
   (swap! *log* conj :close-c1))

 (defcontext c2 []
   (swap! *log* conj :open-c2)
   2
   :after [s]
-;; (assert (= s 2))
+  (assert (= s 2))
   (swap! *log* conj :close-c2))

 (defmacro with-log [& body]


Make chapter menu button as back to home button

--- src/teach_by_friends/shared/scenes/new_design.cljs
+++ src/teach_by_friends/shared/scenes/new_design.cljs
@@ -14,7 +14,8 @@
 										:align-items      "center"
 										:background-color "rgb(72, 86, 155)"}}
 	 [ui/touchable-opacity {:style {:flex        1
-										 :align-items "center"}}
+																	:align-items "center"}
+													:on-press #(dispatch [:nav/pop :chapter])}
 		[ui/text {:style {:color "white"}} "M"]]
 	 [ui/view {:style {:flex        5
 										 :align-items "center"}}


Commented out test for images in a bucket

--- test/silly_image_store/handler_test.clj
+++ test/silly_image_store/handler_test.clj
@@ -24,15 +24,28 @@
       (is (= (:status response) 200))
       (is (= (class body) java.io.File))))

-  (testing "list images as json"
-    (let [response (app (mock/request :get "/images"))
-          json-body (json/read-str (:body response))]
-      (is (= (:status response) 200))
-      (is (= json-body
-             [{"name" "another-test.jpg",
-               "url" "http://localhost/images/another-test.jpg"}
-              {"name" "test-all-the-things.jpg",
-               "url" "http://localhost/images/test-all-the-things.jpg"}]))))
+  (testing "listing images"
+    (testing "images from base dir as json"
+      (let [response (app (mock/request :get "/images"))
+            json-body (json/read-str (:body response))]
+        (is (= (:status response) 200))
+        (is (= json-body
+               [{"name" "another-test.jpg",
+                 "url" "http://localhost/images/another-test.jpg"}
+                {"name" "test-all-the-things.jpg",
+                 "url" "http://localhost/images/test-all-the-things.jpg"}]))))
+
+;    (testing "images from bucket as json"
+;      (let [response (app (mock/request :get "/images/things"))
+;            json-body (json/read-str (:body response))]
+;        (is (= (:status response) 200))
+;        (is (= json-body
+;               [{"name" "things.jpg",
+;                 "url" "http://localhost/images/things/things.jpg"}
+;                {"name" "all-things.jpg",
+;                 "url" "http://localhost/images/things/all-things.jpg"}]))))
+
+    )

   (testing "generic not-found route"
     (let [response (app (mock/request :get "/invalid"))]


Fix seek for iterator

Fix seek for iterator

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -34,14 +34,14 @@
   ;; TODO worth doing binary search here when nodes are large
   (seek [this key ix]
         (let [len (alength keys)]
-          (loop [ix ix]
+          (loop [ix (max ix 0)]
             (if (and (< ix len) (> key (aget keys ix)))
               (recur (+ ix 1))
               ix))))
   (assoc! [this key val max-keys]
           (let [ix (.seek this key 0)]
             (if (nil? children)
-              (if (= key (aget keys ix))
+              (if (== key (aget keys ix))
                 (do
                   (aset vals ix val)
                   true)
@@ -57,6 +57,7 @@
            (when (> (alength keys) max-keys)
              (.split! this max-keys)))
   (split! [this max-keys]
+          ;; TODO try using push/pop instead of splice/slice
           (let [median (js/Math.floor (/ max-keys 2))
                 right-node (Node. parent (+ parent-ix 1) nil nil nil)]
             (.insert! parent parent-ix (aget keys median) (aget vals median) right-node)
@@ -72,11 +73,11 @@
                   (let [child (aget right-children ix)]
                     (set (.-parent child) right-node)
                     (set (.-parent-ix child) ix)))))
-            (assert (= (alength keys) (alength vals) (if children (dec (alength children)) (alength keys))))
-            (assert (= (alength (.-keys right-node)) (alength (.-vals right-node)) (if (.-children right-node) (dec (alength (.-children right-node))) (alength (.-keys right-node))))))))
+            #_(assert (= (alength keys) (alength vals) (if children (dec (alength children)) (alength keys))))
+            #_(assert (= (alength (.-keys right-node)) (alength (.-vals right-node)) (if (.-children right-node) (dec (alength (.-children right-node))) (alength (.-keys right-node))))))))

 (deftype Iterator [max-keys ^:mutable node ^:mutable ix]
-  ;; always points to before a valid key or to the root node
+  ;; always points to before a valid key or to the tree wrapper
   Object
   (next [this]
         (when (instance? Node node)
@@ -96,45 +97,22 @@
   (seek [this key] ;; move the iterator forwards until it reaches a key greater than this one
         ;; head across and upwards until we reach a greater key
         (loop []
-          (if (< ix (alength (.-keys node)))
-            (if (<= key (aget (.-keys node) ix))
-              ;; done
-              nil
-              ;; move along
-              (do
-                (set! ix (+ ix 1))
-                (recur)))
-            (let [parent (.-parent node)]
-              (if (instance? Node parent)
-                ;; jump into parent and start again
-                (do
-                  (set! ix (+ (.-parent-ix node) 1))
-                  (set! node parent)
-                  (recur))
-                ;; end of tree
-                nil))))
+          (when (instance? Node node)
+            (set! ix (.seek node key ix))
+            (when (>= ix (alength (.-keys node)))
+              (set! ix (+ (.-parent-ix node) 1))
+              (set! node (.-parent node))
+              (recur))))
         ;; head downwards and across until we reach the least greater key
         (loop []
-          (if (< ix (alength (.-keys node)))
-            (if (<= key (aget (.-keys node) ix))
-              ;; check for a child
-              (if-let [child (and (.-children node) (> ix 0) (aget (.-children node) (- ix 1)))]
-                ;; jump into child and start again (child cannot be empty if tree is correctly balanced)
-                (do
-                  (set! node child)
-                  (set! ix 0)
-                  (recur))
-                ;; done
-                nil)
-              ;; move along
-              (do
-                (set! ix (+ ix 1))
-                (recur)))
-            ;; end of tree
-            nil))
-        (if (< ix (alength (.-keys node)))
-          #js [(aget (.-keys node) ix) (aget (.-vals node) ix)]
-          nil)))
+          (when (instance? Node node)
+            (when-not (nil? (.-children node))
+              (set! node (aget (.-children node) ix))
+              (set! ix (.seek node key 0))
+              (recur))))
+        ;; if we aren't now at the tree wrapper we can return a result
+        (when (instance? Node node)
+          #js [(aget (.-keys node) ix) (aget (.-vals node) ix)])))

 (defn iterator [tree]
   (loop [node (.-root tree)]
@@ -209,6 +187,11 @@
      (dotimes [i 100000]
        (.assoc! tree i (* 2 i)))))

+  (time
+   (let [tree (tree 100)]
+     (dotimes [i 500000]
+       (.assoc! tree i (* 2 i)))))
+
   (let [tree (tree 3)
         iterator (iterator tree)]
     (take 2000 (take-while identity (repeatedly #(.next iterator)))))
@@ -223,4 +206,10 @@
             (.assoc! tree i (* 2 i)))
         iterator (iterator tree)]
     (take 2000 (take-while identity (repeatedly #(.next iterator)))))
+
+  (let [tree (tree 3)
+        _ (dotimes [i 1000]
+            (.assoc! tree i (* 2 i)))
+        iterator (iterator tree)]
+    [(.seek iterator -100) (.seek iterator 9.34) (.seek iterator 0) (.seek iterator 500) (.seek iterator 2000) (.seek iterator 2000)])
   )


Add benchmark for seek

Add benchmark for seek

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -226,4 +226,12 @@
             (.assoc! tree i (* 2 i)))
         iterator (iterator tree)]
     [(.seek iterator -100) (.seek iterator 9.34) (.seek iterator 0) (.seek iterator 500) (.seek iterator 2000) (.seek iterator 2000)])
+
+  (let [tree (tree 3)
+        _ (dotimes [i 1000]
+            (.assoc! tree i (* 2 i)))
+        iterator (iterator tree)]
+    (time
+     (dotimes [i 10000000]
+       [(.seek iterator -100) (.seek iterator 9.34) (.seek iterator 0) (.seek iterator 500) (.seek iterator 2000) (.seek iterator 2000)])))
   )


Add test for lookup

Add test for lookup

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -351,16 +351,32 @@
        :dissoc! (dissoc map (nth action 1))))
    map actions))

-(defn run-denotational-prop [min-keys actions]
+(defn run-building-prop [min-keys actions]
   (let [tree (apply-to-tree (tree min-keys) actions)
         sorted-map (apply-to-sorted-map (sorted-map-by #(cond (== %1 %2) 0 (lt %1 %2) -1 (gt %1 %2) 1)) actions)]
     (and (= (seq (map vec tree)) (seq sorted-map))
          (or (empty? tree) (.valid! tree)))))

-(defn denotational-prop [gen]
+(defn building-prop [gen]
   (prop/for-all [min-keys gen/s-pos-int
                  actions (gen/vector gen)]
-                (run-denotational-prop min-keys actions)))
+                (run-building-prop min-keys actions)))
+
+(defn run-lookup-prop [min-keys actions action]
+  (let [tree (apply-to-tree (tree min-keys) actions)
+        sorted-map (apply-to-sorted-map (sorted-map-by #(cond (== %1 %2) 0 (lt %1 %2) -1 (gt %1 %2) 1)) actions)
+        tree-result (case (nth action 0)
+                      :assoc! (.assoc! tree (nth action 1) (nth action 2))
+                      :dissoc! (.dissoc! tree (nth action 1)))
+        sorted-map-result (contains? sorted-map (nth action 1))]
+    (and (= tree-result sorted-map-result)
+         (or (empty? tree) (.valid! tree)))))
+
+(defn lookup-prop [gen]
+  (prop/for-all [min-keys gen/s-pos-int
+                 actions (gen/vector gen)
+                 action gen]
+                (run-lookup-prop min-keys actions action)))

 ;; TODO test assoc!/dissoc! results
 ;; TODO iterator tests
@@ -373,8 +389,8 @@
   (dc/quick-check 1000 transitive-prop)
   (dc/quick-check 1000 anti-symmetric-prop)
   (dc/quick-check 1000 total-prop)
-  (dc/quick-check 100 (denotational-prop gen-assoc))
-  (dc/quick-check 100 (denotational-prop gen-action))
+  (dc/quick-check 100 (building-prop gen-assoc))
+  (dc/quick-check 100 (building-prop gen-action))

   (defn f []
     (time


Ring init mvn-repo-local at startup.

Ring init mvn-repo-local at startup.

--- src/carambar/core.clj
+++ src/carambar/core.clj
@@ -1,6 +1,7 @@
 (ns carambar.core
   (:use ring.util.response)
   (:require [carambar.repository :as repository]
+            [carambar.pom :as pom]
             [compojure.handler :as handler]
             [compojure.route :as route]
             [compojure.core :refer [GET defroutes]]
@@ -15,7 +16,7 @@
 (defn init
   "Init carambar settings"
   []
-  (log/info "Init carambar"))
+  (log/info "Init carambar : " pom/mvn-local-repo))

 (def app (-> (handler/api app-routes)


Add a doc string mentioning marc21 standard source

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -6,6 +6,7 @@
             [clojure.data.zip.xml :refer [xml-> xml1-> attr= text]]))

 (def ^:private param-mapping
+  "Mapping from Marc21 XML to parameters. See [MARC 21 Format for Bibliographic Data](http://www.loc.gov/marc/bibliographic/)"
   {:title [:datafield (attr= :tag "245") :subfield (attr= :code "a")]
    :subtitle [:datafield (attr= :tag "245") :subfield (attr= :code "b")]
    :creator [:datafield (attr= :tag "100") :subfield]


Remove map monad implementation, doesn't form a monad

--- src/cats/builtin.cljc
+++ src/cats/builtin.cljc
@@ -248,22 +248,6 @@
     (-fmap [_ f v]
       (into {} (map f v)))

-    ;; FIXME: do these make sense or are useful?
-    ;; p/Monad
-    ;; (-mreturn [_ v]
-    ;;   (into {} [v]))
-
-    ;; (-mbind [_ self f]
-    ;;   (into {} (mapcat f self)))
-
-    ;; p/MonadZero
-    ;; (-mzero [_]
-    ;;   {})
-
-    ;; p/MonadPlus
-    ;; (-mplus [_ mv mv']
-    ;;   (merge mv mv'))
-
     p/Foldable
     (-foldr [ctx f z xs]
       (letfn [(rf [acc v] (f v acc))]


Solve CSV response issue

Solve CSV response issue

--- src/cfpb/qu/views.clj
+++ src/cfpb/qu/views.clj
@@ -19,7 +19,8 @@
    [cfpb.qu.query.select :as select]
    [cheshire.generate :refer [add-encoder encode-str]]
    [clojurewerkz.urly.core :as url]
-   [lonocloud.synthread :as ->])
+   [lonocloud.synthread :as ->]
+   [liberator.representation :refer [ring-response]])
   (:import [clojurewerkz.urly UrlLike]))

 ;; Allow for encoding of UrlLike's in JSON.
@@ -255,7 +256,8 @@
           links (map #(str "<" (:href %) ">; rel=" (:rel %)) links)]
       (->> (str (write-csv (vector columns)) (write-csv rows))
            (response/content-type "text/csv; charset=utf-8")
-           (response/set-headers {"Link" (str/join ", " links)})))))
+           (response/set-headers {"Link" (str/join ", " links)})
+           (ring-response)))))

 (defmethod slice "application/json" [_ resource _]
   (hal/resource->representation resource :json))


Comment out the backend code, to allow heroku to start

--- src/circleci/init.clj
+++ src/circleci/init.clj
@@ -5,9 +5,10 @@
   (:require circleci.web)
   (:require circleci.repl)
   (:require circleci.logging)
-  (:require circleci.backend.nodes
-            circleci.backend.project.rails
-            circleci.backend.project.circleci))
+  ;; (:require circleci.backend.nodes
+  ;;           circleci.backend.project.rails
+  ;;           circleci.backend.project.circleci)
+  )

 (def init*
   (delay


CLJS-1090: macros imported from clojure.core missing docs

Need to copy over additional metadata from original var.

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -47,14 +47,30 @@
 (defmacro import-macros [ns [& vars]]
   (core/let [ns (find-ns ns)
              vars (map #(ns-resolve ns %) vars)
-             syms (map (core/fn [^clojure.lang.Var v] (core/-> v .sym (with-meta {:macro true}))) vars)
-             defs (map (core/fn [sym var]
-                                `(do (def ~sym (deref ~var))
-                                     ;for AOT compilation
-                                     (alter-meta! (var ~sym) assoc :macro true)))
-                       syms vars)]
-            `(do ~@defs
-                 :imported)))
+             syms (map
+                    (core/fn [^clojure.lang.Var v]
+                      (core/-> v .sym
+                        (with-meta
+                          (merge
+                            {:macro true}
+                            (update-in (select-keys (meta v) [:arglists :doc :file :line])
+                              [:arglists] (core/fn [arglists] `(quote ~arglists)))))))
+                    vars)
+             defs (map
+                    (core/fn [sym var]
+                      (core/let [{:keys [arglists doc file line]} (meta sym)]
+                        `(do
+                           (def ~sym (deref ~var))
+                           ;for AOT compilation
+                           (alter-meta! (var ~sym) assoc
+                             :macro true
+                             :arglists ~arglists
+                             :doc ~doc
+                             :file ~file
+                             :line ~line))))
+                    syms vars)]
+    `(do ~@defs
+         :imported)))

 (import-macros clojure.core
  [-> ->> .. assert comment cond


Finished query to only return proper subdatasets.

--- src/clj/forma/hdf.clj
+++ src/clj/forma/hdf.clj
@@ -53,8 +53,6 @@
   ([tdir]
      (i/delete-file-recursively tdir)))

-(def opened-file (gdal/Open "/Users/sritchie/Desktop/MODISTEST/MOD13A3.A2000183.h08v06.005.2006310224652.hdf"))
-
 (def subdata-map {:evi "monthly EVI"
                   :qual "VI Quality"
                   :red "red reflectance"
@@ -69,14 +67,14 @@
 (def forma-sets #{:ndvi :evi :qual :reli})

 (defn keep-dataset? [entry]
-  (and (s/substring? "_NAME" (.getKey entry))
-       (some #(s/substring? % (.getValue entry)) (vals subdata-map))))
+  (let [val (.getValue entry)
+        key (.getKey entry)]
+    (and (s/substring? "_NAME" key)
+         (some #(s/substring? % val)
+               (map subdata-map forma-sets)))))

+;; the QUERY to use. TODO: make sure this associates the key with the
+;; subdataset.
 (let [metadata (.GetMetadata_Dict opened-file "SUBDATASETS")]
   (map #(gdal/Open (.getValue %))
-       (filter keep-dataset? metadata)))
-
-;; (let [metadata (.GetMetadata_Dict opened-file "SUBDATASETS")]
-;;   (map-indexed #(.get metadata %2)
-;;                (filter #(s/substring? "_NAME" %)
-;;                        (enumeration-seq (.keys metadata)))))+       (filter keep-dataset? metadata)))


no more search bar at the top. add about page

--- src/clj/hsm/views.clj
+++ src/clj/hsm/views.clj
@@ -124,15 +124,18 @@
                   [:li [:a {:href "/open-source/"} "Top Projects"]]
                   ; [:li [:a {:href "/collections"} "Collections"]]
                   [:li [:a {:href "/discussions"} "Discussions"]]
+
                    [:li.dropdown
                      [:a.dropdown-toggle {:data-toggle "dropdown" :href "#"} "Platforms" [:span.caret]]
                      [:ul.dropdown-menu
                        (for [lang languages]
-                         [:li [:a {:href (format "/%s/index" lang) } lang]])]]]
-                  [:form.navbar-form.navbar-left {:method "GET" :action "/p/"}
-                    [:div.form-group
-                      [:input.form-control.typeahead.input-xs {:type "text" :name "project"}]]
-                      [:button.btn.btn-default.btn-xs {:type "Submit" :onclick "window.location='/p/'+ $(this).parents('form').find('input').val();return false;"} "Go"]]
+                         [:li [:a {:href (format "/%s/index" lang) } lang]])]]
+                  [:li [:a {:href "/about"} "About"]]
+                  ]
+                  ; [:form.navbar-form.navbar-left {:method "GET" :action "/p/"}
+                  ;   [:div.form-group
+                  ;     [:input.form-control.typeahead.input-xs {:type "text" :name "project"}]]
+                  ;     [:button.btn.btn-default.btn-xs {:type "Submit" :onclick "window.location='/p/'+ $(this).parents('form').find('input').val();return false;"} "Go"]]
                   [:ul.nav.navbar-nav.navbar-right [:li [:a "Hello"] ]]]]]
         [:div.container-fluid
           ; [:div.col-lg-1.left-panel ""]


core/request-config, adds 'normalize-uri' parameter. default true. (#583)

Co-authored-by: Torkus <b3a7311981f6f15df0247371bc500c41bb5b2af5@users.noreply.github.com>

--- src/clj_http/core.clj
+++ src/clj_http/core.clj
@@ -162,7 +162,8 @@
                               cookie-spec
                               ; deprecated
                               conn-request-timeout
-                              conn-timeout]
+                              conn-timeout
+                              normalize-uri]
                        :as req}]
   (let [config (-> (RequestConfig/custom)
                    (.setConnectTimeout (or connection-timeout conn-timeout -1))
@@ -174,7 +175,8 @@
                     (boolean (opt req :allow-circular-redirects)))
                    (.setRelativeRedirectsAllowed
                     ((complement false?)
-                     (opt req :allow-relative-redirects))))]
+                     (opt req :allow-relative-redirects)))
+                   (.setNormalizeUri (or normalize-uri true)))]
     (if cookie-spec
       (.setCookieSpec config CUSTOM_COOKIE_POLICY)
       (.setCookieSpec config (get-cookie-policy req)))


Make `make` more flexible:

Make `make` more flexible:

- aim is to accept resource URLs as arguments, so that a library can
  include stan models in its JAR file.

--- src/clj_stan/core.clj
+++ src/clj_stan/core.clj
@@ -17,7 +17,8 @@
             [clj-stan.read-output :as output]
             [me.raynes.conch :as conch]
             [environ.core :refer [env]]
-            [clojure.java.io :as io]))
+            [clojure.java.io :as io]
+            [clojure.string :as str]))

 (defn execute
   [& args]
@@ -74,35 +75,64 @@
            ~@body)
          (throw (Exception. (str "File " ~in " not found."))))))

+(defmulti model-path
+  "Takes a file name, a file object, a resource url, or similar.
+  Returns a file path that can be passed to the `stanc` executable; if
+  necessary by writing out the data to a new file in the `target`
+  directory. Returns `nil` if this is not possible."
+  type)
+
+(defmethod model-path java.lang.String
+  [filename]
+  (when (.exists (io/file filename))
+    filename))
+
+(defmethod model-path java.io.File
+  [file]
+  (when (.exists file)
+    (.getPath file)))
+
+(defmethod model-path java.net.URL
+  [url]
+  (if (.exists (io/file (.getPath url)))
+    (.getPath url)
+    (let [filename (str "target/stan/" (last (str/split (.getPath url) #"/")))
+          _ (io/make-parents filename)]
+      (spit filename (slurp (.getContent url)))
+      filename)))
+
 (defn make
-  [model-file output]
-  (if-let [home (env :stan-home)]
-    (let [executable (str "target/stan/" output)
-          _ (io/make-parents executable)
-          hpp-file (str executable ".hpp")]
-      (make-step
-       model-file hpp-file
-       (println (format "Compiling model %s to C++." model-file))
-       (execute (str home "/bin/stanc") model-file (str "--o=" hpp-file)))
-      (make-step
-       hpp-file executable
-       (println (format "Compiling C++ %s into executable %s." hpp-file executable))
-       (execute "g++"
-                (str "-I" home "/src")
-                (str "-I" home "/stan/src")
-                "-isystem" (str home "/stan/lib/stan_math/")
-                "-isystem" (str home "/stan/lib/stan_math/lib/eigen_3.3.3")
-                "-isystem" (str home "/stan/lib/stan_math/lib/boost_1.62.0")
-                "-isystem" (str home "/stan/lib/stan_math/lib/cvodes_2.9.0/include")
-                "-Wall"
-                "-DEIGEN_NO_DEBUG" "-DBOOST_RESULT_OF_USE_TR1" "-DBOOST_NO_DECLTYPE"
-                "-DBOOST_DISABLE_ASSERTS" "-DFUSION_MAX_VECTOR_SIZE=12" "-DNO_FPRINTF_OUTPUT"
-                "-pipe" "-Wno-unused-local-typedefs" "-lpthread"
-                "-O3" "-o" executable
-                (str home "/src/cmdstan/main.cpp")
-                "-include" hpp-file
-                (str home "/stan/lib/stan_math/lib/cvodes_2.9.0/lib/libsundials_nvecserial.a")
-                (str home "/stan/lib/stan_math/lib/cvodes_2.9.0/lib/libsundials_cvodes.a")))
-      (->CompiledModel executable))
-    (throw (Exception.
-            "STAN_HOME environment variable is not set. See `clj-stan` documentation."))))
+  [model-file-or-resource output]
+  (let [home (or (env :stan-home)
+                 (throw (Exception. "STAN_HOME environment variable is not set.
+                                     See `clj-stan` documentation.")))
+        model-file (or (model-path model-file-or-resource)
+                       (throw (Exception. (str "Cannot recover the resource "
+                                               model-file-or-resource))))
+        executable (str "target/stan/" output)
+        _ (io/make-parents executable)
+        hpp-file (str executable ".hpp")]
+    (make-step
+     model-file hpp-file
+     (println (format "Compiling model %s to C++." model-file))
+     (execute (str home "/bin/stanc") model-file (str "--o=" hpp-file)))
+    (make-step
+     hpp-file executable
+     (println (format "Compiling C++ %s into executable %s." hpp-file executable))
+     (execute "g++"
+              (str "-I" home "/src")
+              (str "-I" home "/stan/src")
+              "-isystem" (str home "/stan/lib/stan_math/")
+              "-isystem" (str home "/stan/lib/stan_math/lib/eigen_3.3.3")
+              "-isystem" (str home "/stan/lib/stan_math/lib/boost_1.62.0")
+              "-isystem" (str home "/stan/lib/stan_math/lib/cvodes_2.9.0/include")
+              "-Wall"
+              "-DEIGEN_NO_DEBUG" "-DBOOST_RESULT_OF_USE_TR1" "-DBOOST_NO_DECLTYPE"
+              "-DBOOST_DISABLE_ASSERTS" "-DFUSION_MAX_VECTOR_SIZE=12" "-DNO_FPRINTF_OUTPUT"
+              "-pipe" "-Wno-unused-local-typedefs" "-lpthread"
+              "-O3" "-o" executable
+              (str home "/src/cmdstan/main.cpp")
+              "-include" hpp-file
+              (str home "/stan/lib/stan_math/lib/cvodes_2.9.0/lib/libsundials_nvecserial.a")
+              (str home "/stan/lib/stan_math/lib/cvodes_2.9.0/lib/libsundials_cvodes.a")))
+    (->CompiledModel executable)))


score_id -> scores_id for consistency.

score_id -> scores_id for consistency.

--- src/cavm/h2.clj
+++ src/cavm/h2.clj
@@ -124,9 +124,8 @@
   ["CREATE TABLE IF NOT EXISTS `field_score` (
    `field_id` INT,
    `i` INT,
-   `score_id` INT,
+   `scores_id` INT,
    UNIQUE (`field_id`, `i`))"])
-; XXX ugh. score_id vs scores.id

 (def cohorts-table
   ["CREATE TABLE IF NOT EXISTS `cohorts` (
@@ -406,7 +405,7 @@
   (subselect field (fields :id) (where {:dataset_id exp})))

 (defn- scores-with-fields [fs]
-  (subselect field_score (fields :score_id) (where {:field_id [in fs]})))
+  (subselect field_score (fields :scores_id) (where {:field_id [in fs]})))

 (defn- clear-by-exp [exp]
   (let [f (fields-in-exp exp)]
@@ -562,7 +561,7 @@
     score-id))

 (defn- insert-field-score [field-id i score-id]
-  (insert field_score (values {:field_id field-id :i i :score_id score-id})))
+  (insert field_score (values {:field_id field-id :i i :scores_id score-id})))

 (defn- table-writer-default [dir f]
   (f {:insert-field insert-field
@@ -897,7 +896,7 @@
                      :join  [{:table  [[[:name2 :varchar fields]] :T]}  [:= :name2 :field.name]]
                      :where [:= :dataset_id dataset-id]} :P]]
             :left-join [:field_score [:= :P.id :field_score.field_id]]}]
-    :left-join [:scores [:= :score_id :scores.id]]})
+    :left-join [:scores [:= :scores_id :scores.id]]})

 ; {"foxm1" [{:NAME "foxm1" :SCORES <bytes>} ... ]
 (let [concat-field-bins
@@ -981,7 +980,7 @@
        INNER JOIN TABLE(name varchar=?) T ON T.`name`=`field`.`name`
        WHERE (`field`.`dataset_id` = ?)) P
    LEFT JOIN `field_score` ON P.id = `field_score`.`field_id` WHERE `field_score`.`i` IN (%s))
-   LEFT JOIN `scores` ON `score_id` = `scores`.`id`")
+   LEFT JOIN `scores` ON `scores_id` = `scores`.`id`")

 (defn select-scores-full [dataset-id columns bins]
   (let [q (format field-query


Drop deprecated code.

Drop deprecated code.

--- src/cavm/h2.clj
+++ src/cavm/h2.clj
@@ -324,24 +324,6 @@
   (println x)
   x)

-; reset any columns left unspecified, and filter by
-; db columns.
-(defn- normalize-experiment-meta [metadata]
-  (select-keys
-    (merge experiments-defaults (clojure.walk/keywordize-keys metadata))
-    experiments-columns))
-
-; Update experiment record.
-(defn- merge-exp [{ename "name" :as metadata}]
-  (let [normmeta (normalize-experiment-meta metadata)
-        [{id :ID}] (select experiments (fields :id) (where {:name ename}))]
-    (if id
-      (do
-        (update experiments (set-fields normmeta) (where {:id id}))
-        id)
-      (insert experiments (values normmeta)))))
-
-
 (defn- normalize-meta [m-ent metadata]
   (select-keys
     (merge (:defaults m-ent) (clojure.walk/keywordize-keys metadata))
@@ -514,14 +496,6 @@
 ;
 ; probemap routines
 ;
-
-(defn- merge-probemap [file timestamp filehash]
-  ; Use a merge to avoid losing the key, which datasets may be referencing.
-  (exec-raw ["MERGE INTO probemaps (file, time, hash) KEY(file) VALUES (?, ?, ?)"
-             [file (format-timestamp timestamp) filehash]])
-   (let [[{probemap :ID}] (select probemaps (where {:file file}))]
-     (delete probemap_probes (where {:probemaps_id probemap}))
-     probemap))

 (defn- add-probemap-probe [pmid probe]
   (let [pmp


Use `juxt` where idiomatic

Use `juxt` where idiomatic

--- src/refactor_nrepl/ns/libspecs.clj
+++ src/refactor_nrepl/ns/libspecs.clj
@@ -12,7 +12,7 @@

 (defn- aliases [libspecs]
   (->> libspecs
-       (map #(vector (:as %) (:ns %)))
+       (map (juxt :as :ns))
        (remove #(nil? (first %)))
        distinct))


fix imports for heroku/config.clj

fix imports for heroku/config.clj

--- src/ruuvi_server/heroku/config.clj
+++ src/ruuvi_server/heroku/config.clj
@@ -1,5 +1,7 @@
 (ns ruuvi-server.heroku.config
   (:import java.net.URI)
+  (:use korma.db)
+  (:use ruuvi-server.database)
   )

 (def *database-config*


Make site generation pure functional

Make site generation pure functional

--- demo/sitetools/core.cljs
+++ demo/sitetools/core.cljs
@@ -120,18 +120,12 @@
   (let [depth (-> #"/" (re-seq (as-relative page)) count)]
     (str (->> "../" (repeat depth) (apply str)) href)))

-(defn body []
-  (let [b (:body @config)]
-    (assert (vector? b) (str "body is not a vector: " b))
-    b))
-
 (defn danger [t s]
   [t {:dangerouslySetInnerHTML {:__html s}}])

-(defn html-template [{:keys [title body timestamp page-conf
-                             req]}]
-  (let [{:keys [js-file css-file main-div]} @config
-        main (str js-file timestamp)]
+(defn html-template [{:keys [title body-html timestamp page-conf
+                             js-file css-file main-div]}]
+  (let [main (str js-file timestamp)]
     (r/render-to-static-markup
      [:html
       [:head
@@ -142,19 +136,20 @@
        [:link {:href (str css-file timestamp) :rel 'stylesheet}]
        [:title title]]
       [:body
-       [:div {:id main-div} (danger :div body)]
+       [:div {:id main-div} (danger :div body-html)]
        (danger :script (str "var pageConfig = "
                             (-> page-conf clj->js js/JSON.stringify)))
        [:script {:src main :type "text/javascript"}]]])))

-(defn gen-page [page-name timestamp]
+(defn gen-page [page-name conf]
   (dispatch [:set-page page-name])
-  (let [b (r/render-component-to-string (body))]
+  (let [b (:body conf)
+        _ (assert (vector? b))
+        bhtml (r/render-component-to-string b)]
     (str "<!doctype html>"
-         (html-template {:title (:title @config)
-                         :body b
-                         :page-conf {:page-name page-name}
-                         :timestamp timestamp}))))
+         (html-template (assoc conf
+                               :page-conf {:page-name page-name}
+                               :body-html bhtml)))))

 (defn mkdirs [f]
   (let [fs (js/require "fs")
@@ -177,12 +172,12 @@
 (defn path-join [& paths]
   (apply (.' (js/require "path") :join) paths))

-(defn read-css []
-  (string/join "\n" (map read-file (:css-infiles @config))))
-
-(defn write-resources [dir]
-  (write-file (path-join dir (:css-file @config))
-              (read-css)))
+(defn read-css [{cssfiles :css-infiles}]
+  (string/join "\n" (map read-file cssfiles)))
+
+(defn write-resources [dir {file :css-file :as conf}]
+  (write-file (path-join dir file)
+              (read-css conf)))

 ;;; Main entry points
@@ -190,12 +185,12 @@
 (defn ^:export genpages [opts]
   (log "Generating site")
   (swap! config merge (js->clj opts :keywordize-keys true))
-  (let [dir (:site-dir @config)
-        timestamp (str "?" (js/Date.now))]
-    (doseq [f (:pages @config)]
-      (write-file (path-join dir (dbg (as-relative f)))
-                  (gen-page f timestamp)))
-    (write-resources dir))
+  (let [{:keys [site-dir pages] :as conf} @config
+        conf (assoc conf :timestamp (str "?" (js/Date.now)))]
+    (doseq [f pages]
+      (write-file (path-join site-dir (as-relative f))
+                  (gen-page f conf)))
+    (write-resources site-dir conf))
   (log "Wrote site"))

 (defn start! [site-config]
@@ -205,5 +200,5 @@
                  (js->clj js/pageConfig :keywordize-keys true))]
       (swap! config merge conf)
       (init-history)
-      (r/render-component (body)
+      (r/render-component (:body @config)
                           (js/document.getElementById (:main-div @config))))))


Whitespace

Whitespace

--- src/detritus/text.clj
+++ src/detritus/text.clj
@@ -2,34 +2,28 @@
   (:require [detritus.macros :refer [-<>]])
   (:require [clojure.string :as c.s]))

-
 (defn words [text]
   (c.s/split text #"\s+"))

-
 (defn lines [text]
   (c.s/split text #"(\n\r?)+"))

-
 (defn trailing-newline?
   [text]
   {:pre [(string? text)]}
   (= \newline (last text)))
-

 (defn ensure-trailing-newline
   [text]
   (if-not (trailing-newline? text)
     (str text \newline)
     text))
-

 (defn prefix-lines [prefix text]
   (-<> (lines text)
        (map str (repeat prefix) <>)
        (interpose \newline <>)
        (apply str <>)))
-

 (defn wrap-lines
   "(λ Num → String) → String
@@ -71,40 +65,34 @@
         true
         ,,:str))

-
 (defmulti render
   render-dispatch)
-

 (defmethod render :seq
   [forms]
   (->> forms
-     (map render)
-     (apply str)))
-
+       (map render)
+       (apply str)))

 (defmethod render :str
   [& xs]
   (->> xs
-     (map str)
-     (apply str)))
-
+       (map str)
+       (apply str)))

 (defmethod render :indent
   [[_ {width :width
        :or {width 2}
        :as opts} & text]]
   (->> text
-     (map render)
-     (apply str)
-     (prefix-lines (apply str (repeat width \space)))))
-
+       (map render)
+       (apply str)
+       (prefix-lines (apply str (repeat width \space)))))

 (defmethod render :prefix
   [[_ {prefix :prefix :as opts} & text]]
   (->> text
-     (prefix-lines prefix)))
-
+       (prefix-lines prefix)))

 (defmethod render :wrap
   [[_ {width :width
@@ -119,12 +107,10 @@
        (interpose "\n" <>)
        (apply str <>)))

-
 (defmethod render :heading
   [[_ opts & text]]
   (str (apply str text) "\n"
        (str (apply str (repeat 80 \-)) \newline)))
-

 (defmethod render :code
   [[_ {lang :lang :as opts} & text]]
@@ -136,7 +122,6 @@
             "```" \newline)
        (ensure-trailing-newline <>)))

-
 (defmethod render :block
   [[_ opts & text]]
   (-<> text
@@ -152,9 +137,8 @@
   (let [indent (re-find #"\s\s+" text)]
     (if indent
       [:indent {:width (count indent)}
-       (c.s/replace text (re-pattern indent) "")]
+       (c.s/replace text (re-pattern indent) " ")]
       [:str {} text])))
-

 (defn text->paragraph
   [text]
@@ -165,10 +149,9 @@
        (:indent)
        ,,[:indent w
           [:wrap {} text]]
-
+
        (:str)
        ,,[:wrap {} text])]))
-

 (defn text->paragraphs
   "(λ String) → (Seq String)


Added fn for the repl

Added fn for the repl

--- src/fractalz/core.clj
+++ src/fractalz/core.clj
@@ -4,6 +4,12 @@
             [fractalz.pyramid :as pyramid]))

 (defonce plugin (atom nil))
+
+(defn make-sierpinsky-pyramid
+  [size name]
+  (pyramid/make-sierpinsky-pyramid size
+                                   (pyramid/player-by-name name)
+                                   @plugin))

 (defn sierpinsky
   [sender size]


Fix for the current unit test hanging issue.

The current code won't close the database connection
until the HTTP response has been fully consumed. One
of the tests wasn't actually consuming the response,
causing the DB connection to stay open and then hang
on the dropping of the DB table.

--- test/com/puppetlabs/puppetdb/test/http/v2/facts.clj
+++ test/com/puppetlabs/puppetdb/test/http/v2/facts.clj
@@ -63,6 +63,7 @@
     (testing "query without param should not fail"
       (let [response (get-response)
             body     (get response :body "null")]
+        (slurp body)
         (is (= 200 (:status response)))))

     (testing "fact queries"


Add a.l.component.flow/check-permissions logs

--- backend/src/akvo/lumen/component/flow.clj
+++ backend/src/akvo/lumen/component/flow.clj
@@ -29,16 +29,19 @@

 (defn check-permissions
   [flow-api token body]
-  (try
-    (http/post
-     (str (:url flow-api) "/check_permissions")
-     {:as :json
-      :headers (api-headers token)
-      :throw-entire-message? true
-      :unexceptional-status #(<= 200 % 299)
-      :form-params body
-      :content-type :json})
-    (catch Exception e (log/error :fail :body body :response (ex-data e)))))
+  (let [start (. System (nanoTime))
+        res (try
+              (http/post
+               (str (:url flow-api) "/check_permissions")
+               {:as :json
+                :headers (api-headers token)
+                :throw-entire-message? true
+                :unexceptional-status #(<= 200 % 299)
+                :form-params body
+                :content-type :json})
+              (catch Exception e (log/error :fail :body body :response (ex-data e))))]
+    (log/info ::check-permissions :body body :res res :elapsed-time (str "Elapsed time: " (/ (double (- (. System (nanoTime)) start)) 1000000.0) " msecs"))
+    res))

 (defmethod ig/init-key ::api  [_ {:keys [url] :as opts}]
   opts)


Using only copy and throwf from dependent namespaces, which fixes the spit nameclash when using clojure 1.2.

--- ring-servlet/src/ring/util/servlet.clj
+++ ring-servlet/src/ring/util/servlet.clj
@@ -1,6 +1,7 @@
 (ns ring.util.servlet
   "Compatibility functions for turning a ring handler into a Java servlet."
-  (:use (clojure.contrib duck-streams except))
+  (:use [clojure.contrib.except :only (throwf)]
+        [clojure.contrib.duck-streams :only (copy)])
   (:import (java.io File InputStream FileInputStream)
            (javax.servlet.http HttpServlet
                                HttpServletRequest


Additional logging in the scheduler (#129)

* -- additional logging to the scheduler

* -- improved how we track slow healthchecks

* -- feedback from @sradack

--- waiter/src/waiter/scheduler.clj
+++ waiter/src/waiter/scheduler.clj
@@ -11,7 +11,6 @@
 (ns waiter.scheduler
   (:require [clj-time.core :as t]
             [clojure.core.async :as async]
-            [clojure.set :as set]
             [clojure.string :as str]
             [clojure.tools.logging :as log]
             [metrics.timers :as timers]
@@ -401,15 +400,25 @@
 (defn do-health-checks
   "Takes a map from service -> service instances and performs health checks in parallel. Returns a map of service -> service instances."
   [service->service-instances available? service-id->service-description-fn]
-  (let [service->service-instance-futures (start-health-checks service->service-instances available? service-id->service-description-fn)]
-    (loop [[[service {:keys [active-instances] :as instances}] & rest] (seq service->service-instance-futures)
-           service->service-instances' {}]
-      (if-not service
-        service->service-instances'
-        (let [active-instances (doall (map async/<!! active-instances))]
-          (recur rest (assoc service->service-instances'
-                        service
-                        (assoc instances :active-instances active-instances))))))))
+  (let [timeout-threshold-mins 2
+        timeout-channel (async/timeout (-> timeout-threshold-mins t/minutes t/in-millis))
+        slowness-monitor-promise (promise)]
+    (async/go
+      (async/<! timeout-channel)
+      (when (not (realized? slowness-monitor-promise))
+        (log/warn "scheduler-syncer: health checks are taking longer than" timeout-threshold-mins "minute(s) to complete")))
+    (let [service->service-instance-futures (start-health-checks service->service-instances available? service-id->service-description-fn)]
+      (loop [[[service {:keys [active-instances] :as instances}] & rest] (seq service->service-instance-futures)
+             service->service-instances' {}]
+        (if-not service
+          (do
+            (deliver slowness-monitor-promise :done)
+            (async/close! timeout-channel)
+            service->service-instances')
+          (let [active-instances (doall (map async/<!! active-instances))]
+            (recur rest (assoc service->service-instances'
+                          service
+                          (assoc instances :active-instances active-instances)))))))))

 (defn- update-scheduler-state
   "Queries marathon, sends data on app and instance statuses to router state maintainer, and returns scheduler state"
@@ -476,11 +485,13 @@
                                 :instance-id->tracked-failed-instance instance-id->tracked-failed-instance'
                                 :instance-id->failed-health-check-count instance-id->failed-health-check-count'}})
                      scheduler-messages' remaining))
-            (do (log/info (timing-message-fn) "for" (count service->service-instances) "services.")
-                {:service-id->health-check-context service-id->health-check-context'
-                 :scheduler-messages scheduler-messages}))))
-      (do (log/info (timing-message-fn))
-          {:service-id->health-check-context service-id->health-check-context}))))
+            (do
+              (log/info (timing-message-fn) "for" (count service->service-instances) "services.")
+              {:service-id->health-check-context service-id->health-check-context'
+               :scheduler-messages scheduler-messages}))))
+      (do
+        (log/info (timing-message-fn) "and found no active services")
+        {:service-id->health-check-context service-id->health-check-context}))))

 (defn start-scheduler-syncer
   "Starts loop to query marathon for the app and instance statuses,
@@ -530,7 +541,7 @@
                        :priority true)]
             (recur next-state)))
         (catch Exception e
-          (log/error e "Fatal error in service-chan-maintainer")
+          (log/error e "Fatal error in scheduler-syncer")
           (System/exit 1))))
     {:exit-chan exit-chan
      :query-chan state-query-chan}))


fix typo (#776)

fix typo (#776)

--- waiter/src/waiter/scheduler/shell.clj
+++ waiter/src/waiter/scheduler/shell.clj
@@ -690,7 +690,7 @@

   (validate-service [_ service-id]
     (let [{:strs [image]} (service-id->service-description-fn service-id)]
-      (when image (throw (ex-info "Image field is set. Images are not supported with Marathon scheduler" {:image image}))))))
+      (when image (throw (ex-info "Image field is set. Images are not supported with shell scheduler" {:image image}))))))

 (s/defn ^:always-validate create-shell-scheduler
   "Returns a new ShellScheduler with the provided configuration. Validates the


orbifoldInvariant3d.clj: added a slash add the end to match Java

--- clojure/org/gavrog/clojure/orbifoldInvariant3d.clj
+++ clojure/org/gavrog/clojure/orbifoldInvariant3d.clj
@@ -85,4 +85,4 @@
         b [(if (oriented? ds) 2 (if (weakly-oriented? ds) 1 0))
            (reduce + (map (comp count :adjs second) g))
            (count inv)]]
-        (apply str (interpose "/" (concat [(count a)] a b inv)))))
+        (apply str (interpose "/" (concat [(count a)] a b inv [""])))))


Minor docstring improvement

Minor docstring improvement

--- src/icecap/schema.clj
+++ src/icecap/schema.clj
@@ -34,7 +34,7 @@
   "The schema for a request specification.

   Consists either of a `SimpleRequest`, a `RequestSpec` set, or a
-  `RequestSpec` vector.
+  `RequestSpec` vector. (So, this schema is recursive.)

   This uses prismatic/schema's `conditional` with type dispatch,
   rather than the (perhaps more obvious) `either`. If you give it a


Delete .depend.boot

Delete .depend.boot

--- shared_folders/etc/init.d/.depend.boot
+++ shared_folders/etc/init.d/.depend.boot
@@ -1,2 +0,0 @@
-TARGETS =
-INTERACTIVE =


Use manners instead of faulter.

Use manners instead of faulter.

--- src/incise/config.clj
+++ src/incise/config.clj
@@ -1,7 +1,7 @@
 (ns incise.config
   (:require [clojure.java.io :refer [reader file resource]]
             [clojure.edn :as edn]
-            [faulter.core :refer [faultless!]])
+            [manners.victorian :refer [avow!]])
   (:import [java.io PushbackReader])
   (:refer-clojure :exclude [merge load assoc get]))

@@ -18,14 +18,14 @@
   [[(comp string? :in-dir) "must have an input dir"]
    [(comp string? :out-dir) "must have an output dir"]])

-(defn faultless-config!
+(defn avow-config!
   "Throws an AssertionError unless the given config map, or @config if not
   supplied, has no faults."
   [& [given-config]]
-  (faultless! 'config validations (or given-config @config)))
+  (avow! 'config validations (or given-config @config)))

 (defn get [& more]
-  (faultless-config!)
+  (avow-config!)
   (if (empty? more)
     @config
     (apply @config more)))


Serve files instead of resources at configured out-dir.

--- src/incise/server.clj
+++ src/incise/server.clj
@@ -1,5 +1,5 @@
 (ns incise.server
-  (:require (compojure [route :refer [resources not-found]]
+  (:require (compojure [route :refer [files not-found]]
                        [core :refer [defroutes]])
             (hiccup [page :refer [html5]])
             (incise [config :as conf]
@@ -12,8 +12,9 @@
             [clojure.stacktrace :refer [print-cause-trace]]
             [org.httpkit.server :refer [run-server]]))

+(conf/load)
 (defroutes routes
-  (resources "/")
+  (files "/" {:root (conf/get :out-dir)})
   (not-found (html5 [:h1 "404"])))

 (defn wrap-static-index [handler]
@@ -62,7 +63,6 @@
 (defn defserver
   "Start a server and bind the result to a var, 'server'."
   [& args]
-  (conf/load)
   (reset! server (apply serve args)))

 (defn stop-server []


fix transit

fix transit

--- src/replikativ/platform.cljs
+++ src/replikativ/platform.cljs
@@ -27,12 +27,15 @@
     (doto channel
       (events/listen goog.net.WebSocket.EventType.MESSAGE
                      (fn [evt]
-                       (debug "receiving: " (-> evt .-message))
                        (let [reader (transit/reader :json)
                              fr (js/FileReader.)]
-                         (set! (.-onload fr) #(transit/read reader (.-result fr)))
-                         (put! in (with-meta (.readAsText fr (.-message evt))
-                                    {:host host})))))
+                         (set! (.-onload fr) #(put! in
+                                                    (with-meta
+                                                      (transit/read
+                                                       reader
+                                                       (str (js/String. (.. % -target -result))))
+                                                      {:host host})))
+                         (.readAsText fr (.-message evt)))))
       (events/listen goog.net.WebSocket.EventType.CLOSED
                      (fn [evt] (close! in) (.close channel) (close! opener)))
       (events/listen goog.net.WebSocket.EventType.OPENED
@@ -40,12 +43,12 @@
       (events/listen goog.net.WebSocket.EventType.ERROR
                      (fn [evt] (error "ERROR:" evt) (close! opener)))
       (.open url))
-    (fn sender []
-      (take! out
-             (fn [m]
-               (when m
-                 (debug "sending: " m)
-                 (let [writer (transit/writer :json)]
-                   (.send channel (js/Blob. #js [(transit/write writer m)])))
-                 (sender)))))
+    ((fn sender []
+       (take! out
+              (fn [m]
+                (when m
+                  (debug "Sending: " m)
+                  (let [writer (transit/writer :json)]
+                    (.send channel (js/Blob. #js [(transit/write writer m)])))
+                  (sender))))))
     opener))


add more sorting options for instrumentation

--- src-cljs/frontend/instrumentation.cljs
+++ src-cljs/frontend/instrumentation.cljs
@@ -113,7 +113,8 @@
 (defn stats-view [data owner]
   (reify
     om/IInitState (init-state [_] {:shown? false
-                                   :sort-orders (cycle [:last-update :display-name])})
+                                   :sort-orders (cycle [:last-update :display-name
+                                                        :mount-count :render-count])})
     om/IRenderState
     (render-state [_ {:keys [shown? sort-orders]}]
       (dom/figure nil
@@ -123,9 +124,10 @@

         (when shown?
           (let [sort-order (first sort-orders)
-                stats-compare (if (= sort-order :display-name)
-                                compare-display-name
-                                compare-last-update)
+                stats-compare (case sort-order
+                                :last-update compare-last-update
+                                :display-name compare-display-name
+                                (fn [x y] (compare (sort-order x) (sort-order y))))
                 stats (map (fn [[display-name renders]]
                              (let [render-times (filter identity (mapcat :render-ms renders))
                                    mount-times (filter identity (mapcat :mount-ms renders))]


Remove FIXME of invalid syntax.

Remove FIXME of invalid syntax.

--- test/active/clojure/match_test.clj
+++ test/active/clojure/match_test.clj
@@ -278,9 +278,6 @@
                :d {"Z" 42 "X" 65
                    "W" {"foo" "bar"}}}))))
   (t/testing "More optionals"
-    ;; FIXME: Is this a flat-key-exist matched on the symbol '?'?
-    ;; error: java.lang.IllegalArgumentException: No matching clause: {}
-    ;; (t/is (= [] ((p/map-matcher [? :a] []) {})))
     ;; key match without binding
     (t/is (= [] ((p/map-matcher [(? :a)] []) {})))
     (t/is (= [] ((p/map-matcher [(? :a)] []) {:a "a"})))