Skip to content

Commit

Permalink
Tweaks (#26)
Browse files Browse the repository at this point in the history
* adding badges

* join query test
  • Loading branch information
robertluo authored Jan 16, 2022
1 parent de40b80 commit cf199e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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)))
Expand Down
6 changes: 6 additions & 0 deletions test/robertluo/pullable/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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} {}
Expand Down

0 comments on commit cf199e9

Please sign in to comment.