A user reports that certain failing clojure.test assertions involving Java objects can crash Cursive's diff formatting, after which the test appears to pass. This is especially problematic because a real assertion failure is hidden by the crash.
Reproducer
foo/Foo.java:
package foo;
import java.util.function.Predicate;
public interface Foo {
Predicate<String> BAR = s -> true;
}
mytest.clj:
(ns mytest
(:require [clojure.test :as t])
(:import (foo Foo)))
(t/deftest crash
(t/is (= {:k Foo/BAR} {:k nil})))
Actual result
Cursive crashes 100% of the time when running the test, and the test then appears to pass even though the assertion should fail.
Reported stack trace excerpt:
Caused by: java.lang.NullPointerException: null cannot be cast to non-null type com.intellij.psi.PsiElement
at cursive.diff.DiffKt.formatMap(diff.kt:65)
at cursive.diff.DiffKt.toFormat(diff.kt:94)
at cursive.diff.DiffKt.toFormat$lambda$0(diff.kt:99)
...
Expected result
The assertion failure should be reported as a failed test, and Cursive should not crash while formatting/displaying the diff.
Notes
The user has submitted crash reports and raised this because the apparent passing result is deceptive.
A user reports that certain failing
clojure.testassertions involving Java objects can crash Cursive's diff formatting, after which the test appears to pass. This is especially problematic because a real assertion failure is hidden by the crash.Reproducer
foo/Foo.java:mytest.clj:Actual result
Cursive crashes 100% of the time when running the test, and the test then appears to pass even though the assertion should fail.
Reported stack trace excerpt:
Expected result
The assertion failure should be reported as a failed test, and Cursive should not crash while formatting/displaying the diff.
Notes
The user has submitted crash reports and raised this because the apparent passing result is deceptive.