Skip to content

Commit 819ab1c

Browse files
committed
addresses #29
more work is needed here
1 parent 39b8ac8 commit 819ab1c

File tree

7 files changed

+45
-5
lines changed

7 files changed

+45
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{:lint-as
1+
{:hooks
2+
{:analyze-call
3+
{expectations.clojure.test/more->
4+
hooks.com.github.seancorfield.expectations/more->}}
5+
:lint-as
26
{expectations.clojure.test/defexpect clojure.test/deftest
37
expectations.clojure.test/from-each clojure.core/for
4-
expectations.clojure.test/more-of clj-kondo.lint-as/def-catch-all}}
8+
expectations.clojure.test/more-of clj-kondo.lint-as/def-catch-all
9+
expectations.clojure.test/=? clojure.core/=}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(ns hooks.com.github.seancorfield.expectations
2+
(:require [clj-kondo.hooks-api :as api]))
3+
4+
(defn more-> [{:keys [node]}]
5+
(let [tail (rest (:children node))
6+
rewritten
7+
(api/list-node
8+
(list*
9+
(api/token-node 'cond->)
10+
(api/token-node 'nil)
11+
tail))]
12+
{:node rewritten}))

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Only accretive/fixative changes will be made from now on.
88

99
* 2.0.next in progress
1010
* Fix [#30](https://github.com/clojure-expectations/clojure-test/issues/30) by removing `build-clj` and using raw `tools.build`.
11+
* Address [#29](https://github.com/clojure-expectations/clojure-test/issues/29) by providing a "hook" for `more->` (but more work is needed).
1112
* Address [#27](https://github.com/clojure-expectations/clojure-test/issues/27) by changing `refer`'d note in stub macros' docstrings.
1213

1314
* 2.0.160 -- 2022-03-26
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{:lint-as
1+
{:hooks
2+
{:analyze-call
3+
{expectations.clojure.test/more->
4+
hooks.com.github.seancorfield.expectations/more->}}
5+
:lint-as
26
{expectations.clojure.test/defexpect clojure.test/deftest
37
expectations.clojure.test/from-each clojure.core/for
4-
expectations.clojure.test/more-of clj-kondo.lint-as/def-catch-all}}
8+
expectations.clojure.test/more-of clj-kondo.lint-as/def-catch-all
9+
expectations.clojure.test/=? clojure.core/=}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(ns hooks.com.github.seancorfield.expectations
2+
(:require [clj-kondo.hooks-api :as api]))
3+
4+
(defn more-> [{:keys [node]}]
5+
(let [tail (rest (:children node))
6+
rewritten
7+
(api/list-node
8+
(list*
9+
(api/token-node 'cond->)
10+
(api/token-node 'nil)
11+
tail))]
12+
{:node rewritten}))

src/expectations/clojure/test.cljc

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
:cljs js/Error.)
4444
(str ~s " should only be used inside expect"))))
4545

46+
(defmacro =?
47+
"Internal fuzzy-equality test (clojure.test/assert-expr)."
48+
[expected actual & [form]]
49+
(bad-usage "=?"))
50+
4651
(defmacro in
4752
"`(expect expected (in actual))` -- expect a subset of a collection.
4853

test/expectations/clojure/test_test.cljc

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#?(:cljs [cljs.spec.alpha :as s])
2020
#?(:cljs [expectations.clojure.test-spec])
2121
#?(:clj [expectations.clojure.test :refer
22-
[from-each in more more-of] :as sut]
22+
[from-each in more more-> more-of =?] :as sut]
2323
:cljs [expectations.clojure.test
2424
:include-macros true
2525
:as sut])))

0 commit comments

Comments
 (0)