Skip to content

Commit

Permalink
Merge pull request #6 from lilactown/auto-quote
Browse files Browse the repository at this point in the history
automatically quote expectation-form in => tests
  • Loading branch information
matthewdowney committed Dec 11, 2022
2 parents 2be8244 + f0b512d commit ce2b98c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/com/mjdowney/rich_comment_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
; doesn't start with =>
(apply assoc {} (repeatedly 2 rand))
; {0.10999946790750348 0.4352718677404722}

(map inc [1 2 3])
;; => (2 3 4)
)

;;; End example code
Expand Down Expand Up @@ -191,7 +194,7 @@
(drop 4)
first
:expectation-type)
;=> '=>>
;=> =>>
)

(defn clojure-test-reporting-active? [] (some? test/*report-counters*))
Expand Down
2 changes: 1 addition & 1 deletion src/com/mjdowney/rich_comment_tests/emit_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
fname (.getName (io/file *file*))
test-form (list '= test-sexpr expectation-form)]
`(let [form-result# ~(try-bind-repl-vars test-sexpr line-number *file*)
test-result# (= form-result# ~expectation-form)]
test-result# (= form-result# '~expectation-form)]

(if test-result#
(test/do-report
Expand Down

0 comments on commit ce2b98c

Please sign in to comment.