<commit_before>(ns flatland.useful.dispatch-test
  (:use clojure.test flatland.useful.dispatch
        [clojure.walk :only [stringify-keys]])

  ;; not used directly, but added to verify that imported functions aren't exposed via dispatcher
  (:require [clojure.set :refer [rename-keys]]))

(deftest test-dispatcher-fn
  (let [dispatch (dispatcher (fn [f & args] (symbol "clojure.core" f)))]
    (is (= "str5" (dispatch "str" 5)))))

(deftest test-imported-functions
  (let [fn-name 'flatland.useful.dispatch-test/rename-keys
        dispatch (dispatcher (constantly fn-name))]
    (prn (dispatch {:a 1} {:a :b}))
    (is (thrown? Exception (dispatch {:a 1} {:a :b})))))

(deftest test-dispatch<commit_msg>Remove an apparently stray debugging prn that was causing tests to fail.<commit_after>(ns flatland.useful.dispatch-test
  (:use clojure.test flatland.useful.dispatch
        [clojure.walk :only [stringify-keys]])

  ;; not used directly, but added to verify that imported functions aren't exposed via dispatcher
  (:require [clojure.set :refer [rename-keys]]))

(deftest test-dispatcher-fn
  (let [dispatch (dispatcher (fn [f & args] (symbol "clojure.core" f)))]
    (is (= "str5" (dispatch "str" 5)))))

(deftest test-imported-functions
  (let [fn-name 'flatland.useful.dispatch-test/rename-keys
        dispatch (dispatcher (constantly fn-name))] 
    (is (thrown? Exception (dispatch {:a 1} {:a :b})))))

(deftest test-dispatch
{'fraction_non_alphanumeric': 0.15041782729805014, 'fraction_numerical': 0.004874651810584958, 'mean_word_length': 4.283088235294118, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6873504', 'n_tokens_mistral': 499, 'n_tokens_neox': 480, 'n_words': 138}