From d0431b8bb65b971db799ada3bb6c7ccc0fc543b6 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 1 Mar 2021 12:17:04 +0100 Subject: [PATCH] [#741] Fix cyclic dep problem with doric lib --- sci | 2 +- .../lib_tests/babashka/run_all_libtests.clj | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/sci b/sci index 0d35c1ff..b74cdc1f 160000 --- a/sci +++ b/sci @@ -1 +1 @@ -Subproject commit 0d35c1ffadb574afe3a130b5918dbf7dd19b2169 +Subproject commit b74cdc1f7f1e9a9136a7439b828f02f22251b901 diff --git a/test-resources/lib_tests/babashka/run_all_libtests.clj b/test-resources/lib_tests/babashka/run_all_libtests.clj index 2bc95639..317ab5c7 100644 --- a/test-resources/lib_tests/babashka/run_all_libtests.clj +++ b/test-resources/lib_tests/babashka/run_all_libtests.clj @@ -6,10 +6,12 @@ (def status (atom {})) +(defn test-namespace? [ns] + (or (empty? ns-args) + (contains? ns-args ns))) + (defn test-namespaces [& namespaces] - (let [namespaces (if (seq ns-args) - (seq (keep ns-args namespaces)) - namespaces)] + (let [namespaces (seq (filter test-namespace? namespaces))] (when namespaces (doseq [ns namespaces] (require ns)) @@ -121,7 +123,14 @@ ;;;; doric -(test-namespaces 'doric.test.core) +(defn test-doric-cyclic-dep-problem + [] + (require '[doric.core :as d]) + ((resolve 'doric.core/table) [:a :b] [{:a 1 :b 2}])) + +(when (test-namespace? 'doric.test.core) + (test-doric-cyclic-dep-problem) + (test-namespaces 'doric.test.core)) ;;;; cljc-java-time