<commit_before>(ns user
  (:require [clojure.tools.namespace.repl :as repl]
            [clojure.walk :refer [macroexpand-all]]
            [clojure.pprint :refer [pprint]]
            [clojure.test :as test]))

;; --- Development Stuff

(defn test-vars
  [& vars]
  (repl/refresh)
  (test/test-vars
   (map (fn [sym]
          (require (symbol (namespace sym)))
          (resolve sym))
        vars)))

(defn test-ns
  [ns]
  (repl/refresh)
  (test/test-ns ns))

(defn test-all
  ([] (test/run-all-tests #"^datoteka.tests.*"))
  ([re] (test/run-all-tests re)))<commit_msg>Add better test helper to user ns.<commit_after>(ns user
  (:require [clojure.tools.namespace.repl :as repl]
            [clojure.walk :refer [macroexpand-all]]
            [clojure.pprint :refer [pprint]]
            [clojure.test :as test]))

;; --- Development Stuff

(defn test
  ([] (test #"^datoteka.tests.*"))
  ([o]
   (repl/refresh)
   (cond
     (instance? java.util.regex.Pattern o)
     (test/run-all-tests o)

     (symbol? o)
     (if-let [sns (namespace o)]
       (do (require (symbol sns))
           (test/test-vars [(resolve o)]))
       (test/test-ns o)))))
{'fraction_non_alphanumeric': 0.17636837532580366, 'fraction_numerical': 0.0, 'mean_word_length': 2.408284023668639, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4572893', 'n_tokens_mistral': 434, 'n_tokens_neox': 425, 'n_words': 94}