diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..6f90fe8 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,22 @@ +name: Test + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + java-version: '17' + + - name: Install clojure tools + uses: DeLaGuardo/setup-clojure@12.5 + with: + cli: 1.11.1.1182 + + - name: Test + run: clojure -X:test diff --git a/deps.edn b/deps.edn index f9a9842..4545a1c 100644 --- a/deps.edn +++ b/deps.edn @@ -8,4 +8,7 @@ :extra-deps {org.clojure/tools.deps.cli {:mvn/version "0.10.55"}} :ns-default clojure.tools.deps.cli.api} :test {:extra-paths ["test" "test-resources"] - :extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}}}}} + :extra-deps {io.github.cognitect-labs/test-runner + {:git/tag "v0.5.1" :git/sha "dfb30dd"}} + :main-opts ["-m" "cognitect.test-runner"] + :exec-fn cognitect.test-runner.api/test}}} diff --git a/src/namenu/deps_diff/core.clj b/src/namenu/deps_diff/core.clj index edb3db6..f3aea71 100644 --- a/src/namenu/deps_diff/core.clj +++ b/src/namenu/deps_diff/core.clj @@ -49,6 +49,6 @@ modified (map (fn [k] [k {:from (get deps-from k) :to (get deps-to k)}]) modified-keys)] - {:removed (into {} removed) - :added (into {} added) - :modified (into {} modified)})) + {:removed (into (sorted-map) removed) + :added (into (sorted-map) added) + :modified (into (sorted-map) modified)})) diff --git a/test/namenu/deps_diff/test.clj b/test/namenu/deps_diff/core_test.clj similarity index 92% rename from test/namenu/deps_diff/test.clj rename to test/namenu/deps_diff/core_test.clj index d862a0c..6d2cdff 100644 --- a/test/namenu/deps_diff/test.clj +++ b/test/namenu/deps_diff/core_test.clj @@ -1,4 +1,4 @@ -(ns namenu.deps-diff.test +(ns namenu.deps-diff.core-test (:require [clojure.spec.alpha :as s] [clojure.test :refer [deftest testing is]] [namenu.deps-diff.core :refer [diff* parse-resolved-tree]] @@ -17,7 +17,7 @@ (testing "aliases" (let [d (diff* base target)] (is (= (update-vals d count) - {:removed 1, :added 11, :modified 31})))) + {:removed 0, :added 0, :modified 6})))) (testing "local/root test" (let [d (diff* base target)] @@ -38,4 +38,8 @@ :paths ["/Users/namenu/.gitlibs/libs/superlifter/superlifter/e0df5b36b496c485c75f38052a71b18f02772cc0/src"]} )))))) -(clojure.test/run-tests) +(comment + (diff-test) + (make-ver-test) + ) +