<commit_before>(ns obb-rules.unit-test
  (:require
    [obb-rules.unit :as unit]
    [clojure.test :refer [deftest testing is]]
    [cljs.test :refer-macros [deftest testing is]]))

(deftest unit-smoke
  (testing "get-units"
    (is (= 20 (count (unit/get-units))))))

(defn- test-unit
  [name code]
  (let [unit (unit/get-unit-by-name name)
        unit-by-code (unit/get-unit-by-code code)]
    (is (= unit unit-by-code))
    (is (= name (unit/unit-name unit)))
    (is (= code (unit/unit-code unit)))
    (is (> (unit/unit-attack unit) 0))
    (is (unit/unit-movement-type unit))
    (is (> (unit/unit-defense unit) 0))))

(defn- verify-unit
  [unit]
  (testing  (test-unit (:name unit) (:code unit))))

(deftest verify-units
  (doseq [unit (unit/get-units)]
    (verify-unit unit)))

(defn- unit-present?<commit_msg>Both test-clj and test-cljs working :)<commit_after>(ns obb-rules.unit-test
  (:require
    [obb-rules.unit :as unit]
    #?(:clj [clojure.test :refer [deftest testing is]]
       :cljs [cljs.test :refer-macros [deftest testing is]])))

(deftest unit-smoke
  (testing "get-units"
    (is (= 20 (count (unit/get-units))))))

(defn- test-unit
  [name code]
  (let [unit (unit/get-unit-by-name name)
        unit-by-code (unit/get-unit-by-code code)]
    (is (= unit unit-by-code))
    (is (= name (unit/unit-name unit)))
    (is (= code (unit/unit-code unit)))
    (is (> (unit/unit-attack unit) 0))
    (is (unit/unit-movement-type unit))
    (is (> (unit/unit-defense unit) 0))))

(defn- verify-unit
  [unit]
  (testing  (test-unit (:name unit) (:code unit))))

(deftest verify-units
  (doseq [unit (unit/get-units)]
    (verify-unit unit)))

(defn- unit-present?
{'fraction_non_alphanumeric': 0.1925133689839572, 'fraction_numerical': 0.004753416518122401, 'mean_word_length': 3.117359413202934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4913200', 'n_tokens_mistral': 681, 'n_tokens_neox': 651, 'n_words': 156}