diff --git a/src/battle_asserts/core.clj b/src/battle_asserts/core.clj index d46fa3d1..0820b31b 100644 --- a/src/battle_asserts/core.clj +++ b/src/battle_asserts/core.clj @@ -22,7 +22,7 @@ (let [generator (build-generator) size (count samples) coll (gen/sample generator (- max-asserts size)) - generated (map #(hash-map :expected (apply solution %) :arguments %) coll)] + generated (distinct (map #(hash-map :expected (apply solution %) :arguments %) coll))] (reduce (fn [acc task] (conj acc (into (sorted-map) task))) generated @@ -68,9 +68,11 @@ (spit filename yaml)) (println (str "Proceeding " issue-name "...")) (let [filename (str "issues/" issue-name ".json") - asserts (generate-asserts build-generator solution samples)] - (if disabled + asserts (generate-asserts build-generator solution samples) + asserts-count (count asserts)] + (if (or disabled (not= asserts-count max-asserts)) (do (println (str issue-name " issue is disabled!")) + (println (str issue-name " issue has: " asserts-count " asserts!")) (write-to-file filename asserts)) (let [signature-errors (util/check-asserts-and-sign asserts @signature)] (if (empty? signature-errors) diff --git a/src/battle_asserts/issues/book_authors.clj b/src/battle_asserts/issues/book_authors.clj index e4b006e7..c4c29873 100644 --- a/src/battle_asserts/issues/book_authors.clj +++ b/src/battle_asserts/issues/book_authors.clj @@ -13,7 +13,7 @@ :ru "Создайте функцию, которая извлекает имена авторов из книг."}) (def signature - {:input [{:argument-name "names" :type {:name "array" :nested {:name "hash" :nested {:name "string"}}}}] + {:input [{:argument-name "books" :type {:name "array" :nested {:name "hash" :nested {:name "string"}}}}] :output {:type {:name "array" :nested {:name "string"}}}}) (defn arguments-generator []