cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Test failure details are not reported in some cases

Open samharad opened this issue 1 year ago • 1 comments

  • Some test failure details are not surfaced by Cursive (missing gutter icons / hover-for-diff functionality), preventing me from understanding what failed and how
  • Issue seems related to a test helper I'm using which is like is, but re-throws exceptions/errors
  • This issue occurs regularly when running tests in the codebase I work on which use this helper
  • I've made two minimal reproduction cases, and they are weird/sensitive, requiring some forms / comments interspersed throughout the tests

Screen Shot 2024-07-15 at 12 21 54 PM

(ns cursive-test
  (:require
    [clojure.test :refer :all]))

(defmacro try-expr!
  "Like clojure.test/try-expr, but re-throws exceptions/errors"
  [msg form]
  `(try
    ~(clojure.test/assert-expr msg form)
    (catch Throwable t#
      (clojure.test/do-report
        {:type :error :message ~msg :expected '~form :actual t#})
      (throw t#))))

(defmacro is!
  "Like clojure.test/is, but re-throws exceptions/errors."
  [form msg]
  `(try-expr! ~msg ~form))

(deftest cursive-inlay-issue-a-test
  (is (= 1 2))
  #_(do
      ;
      )
  (is! true "true")
  :arbitrary)

(deftest cursive-inlay-issue-b-test
  (is (= 1 2))
  #_(do
      ;
      )
  (is! false "false")
  ())

samharad avatar Jul 15 '24 19:07 samharad

This is with:

IntelliJ: IntelliJ IDEA 2024.1.4 (Ultimate Edition), Build #IU-241.18034.62, built on June 20, 2024
Cursive: 1.13.4-eap6-2024.1

samharad avatar Jul 15 '24 19:07 samharad