-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix various false positives for clojure.test (#373)
- Loading branch information
Showing
5 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(ns testcases.clojure-test | ||
(:require | ||
[clojure.test :refer [are assert-expr deftest do-report is join-fixtures testing use-fixtures]])) | ||
|
||
(defmethod assert-expr 'truthy? | ||
[msg [pred v]] | ||
`(do-report (if ~v | ||
{:type :pass, :message ~msg} | ||
{:type :fail, :message ~msg}))) | ||
|
||
(defn throws-exception [] | ||
(throw (ex-info "" {}))) | ||
|
||
(defn func [f] "") | ||
|
||
;; https://github.com/jonase/eastwood/issues/116 | ||
(deftest exercises-thrown | ||
(is (thrown? Exception (throws-exception)))) | ||
|
||
;; https://github.com/jonase/eastwood/issues/313 | ||
(deftest exercises-truthy | ||
(is (truthy? 42))) | ||
|
||
;; https://github.com/jonase/eastwood/issues/207 | ||
(deftest b-test | ||
(is (instance? String (func +)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters