From c278f3bb4d307be0df3c09f04f7aa163c90fccfa Mon Sep 17 00:00:00 2001 From: Mark Wardle Date: Sun, 19 May 2024 13:34:27 +0100 Subject: [PATCH] Fully test synthetically generated descriptions for store/retrieval/indexing and search Closes #66 --- test/com/eldrix/hermes/synth_test.clj | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/test/com/eldrix/hermes/synth_test.clj b/test/com/eldrix/hermes/synth_test.clj index 036a4f0e..fcd9a999 100644 --- a/test/com/eldrix/hermes/synth_test.clj +++ b/test/com/eldrix/hermes/synth_test.clj @@ -9,6 +9,7 @@ [clojure.tools.logging.readable :as log] [com.eldrix.hermes.core :as hermes] [com.eldrix.hermes.gen :as hgen] + [com.eldrix.hermes.impl.search :as search] [com.eldrix.hermes.impl.store :as store] [com.eldrix.hermes.importer :as importer] [com.eldrix.hermes.rf2 :as rf2] @@ -30,7 +31,6 @@ sort reverse (map #(Files/delete %)))))) - (def ^:dynamic *paths*) (defn temporary-paths-fixture @@ -97,6 +97,7 @@ en-GB-refset (gen/generate (rf2/gen-concept {:id 999001261000000100 :active true})) concepts (conj (gen/sample (rf2/gen-concept) (dec n)) en-GB-refset) descriptions (mapcat #(gen/sample (rf2/gen-description {:conceptId (:id %) :typeId snomed/Synonym :active true})) concepts) + descriptions-by-id (group-by :conceptId descriptions) en-GB (hgen/make-language-refset-items descriptions {:refsetId (:id en-GB-refset) :active true :acceptabilityId snomed/Preferred :typeId snomed/Synonym}) relationships (gen/sample (rf2/gen-relationship) n) refset-descriptors (gen/sample (rf2/gen-refset-descriptor-refset) n)] @@ -119,7 +120,22 @@ (is (= n (get-in status [:components :relationships]))) (is (= (count (set (map :refsetId (concat en-GB-refset refset-descriptors)))) (get-in status [:components :refsets]))) (is (= (count concepts) (a/