From cf199e9cfff2df478c4e36c805b0db5261719f46 Mon Sep 17 00:00:00 2001 From: Luo Tian Date: Mon, 17 Jan 2022 01:02:18 +0800 Subject: [PATCH] Tweaks (#26) * adding badges * join query test --- README.md | 2 ++ build.clj | 3 ++- test/robertluo/pullable/core_test.clj | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ad8f33..9cf98d2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Pullable, precisely select from deep data structure. ![CI](https://github.com/robertluo/pullable/workflows/CI/badge.svg) [![codecov](https://codecov.io/gh/robertluo/pullable/branch/master/graph/badge.svg)](https://codecov.io/gh/robertluo/pullable) +[![Clojars Project](https://img.shields.io/clojars/v/robertluo/pullable.svg)](https://clojars.org/robertluo/pullable) +[![Cljdoc](https://cljdoc.org/badge/robertluo/pullable)](https://cljdoc.org/d/robertluo/pullable) ## Rational diff --git a/build.clj b/build.clj index bb8fb1a..c2986af 100644 --- a/build.clj +++ b/build.clj @@ -5,6 +5,7 @@ (def lib 'robertluo/pullable) (def version (format "0.3.%s" (b/git-count-revs nil))) +(def url "https://github.com/robertluo/pullable") (defn tests [opts] @@ -13,7 +14,7 @@ (defn ci [opts] (-> opts - (assoc :lib lib :version version) + (assoc :lib lib :version version :scm {:url url}) (cb/clean) (cb/run-tests) (cb/jar))) diff --git a/test/robertluo/pullable/core_test.clj b/test/robertluo/pullable/core_test.clj index 8b3da01..c6cea45 100644 --- a/test/robertluo/pullable/core_test.clj +++ b/test/robertluo/pullable/core_test.clj @@ -11,6 +11,12 @@ (testing "fn-query throws data error if data is not a map (associative)" (is (thrown? ExceptionInfo (sut/run-query (sut/fn-query :a) 3))))) +(deftest join-query + (are [data exp] (= exp (sut/run-query (sut/join-query (sut/fn-query :a) (sut/fn-query :b)) data)) + {:a {:b 1 :c 2}} {:a {:b 1}} + {:c 3} {} + )) + (deftest filter-query (are [data exp] (= exp (sut/run-query (sut/filter-query (sut/fn-query :a) #(= % 3)) data)) {:a 3} {}