Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binding is not working for clojure.test/report #491

Closed
liquidz opened this issue Jun 21, 2020 · 4 comments
Closed

binding is not working for clojure.test/report #491

liquidz opened this issue Jun 21, 2020 · 4 comments

Comments

@liquidz
Copy link

liquidz commented Jun 21, 2020

version

v0.1.3-SNAPSHOT

platform

macOS Catalina

problem

binding seems not work for clojure.test/report

repro

$ cat foo.clj
(ns foo
  (:require
   [clojure.test :as t]))

(t/deftest bar
  (t/is (= 1 2)))

(binding [t/report println]
  (println "result:"
           (t/test-var #'bar)))
$ ./bb foo.clj

FAIL in (bar) (/Users/uochan/src/github.com/borkdude/babashka/foo.clj:5)
expected: (= 1 2)
  actual: (not (= 1 2))
result: nil

expected behavior

$ clj -i foo.clj
{:type :begin-test-var, :var #'foo/bar}
{:file foo.clj, :line 6, :type :fail, :expected (= 1 2), :actual (not (= 1 2)), :message nil}
{:type :end-test-var, :var #'foo/bar}
result: nil
@borkdude
Copy link
Collaborator

@liquidz I think I have a fix in the fix-dynamic-test-report-var branch. I'll add a test for this tomorrow, but feel free to test it out meanwhile.

@liquidz
Copy link
Author

liquidz commented Jun 21, 2020

@borkdude It works!! (although there is no :file and :line in the failed report)
Thank you so much for your quick response!

$ ./bb foo.clj
{:type :begin-test-var, :var #'foo/bar}
{:type :fail, :expected (= 1 2), :actual (not (= 1 2)), :message nil}
{:type :end-test-var, :var #'foo/bar}
result: nil

@borkdude
Copy link
Collaborator

@liquidz Should be fixed now on master, including :file and :line (hopefully).

@liquidz
Copy link
Author

liquidz commented Jun 22, 2020

@borkdude Awesome! It works perfectly!!
Thank you so much!

II'll add a test integration on plain nREPL server including Babashka, of course!
liquidz/vim-iced#227

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants