cursive

MJ 2026-05-05T18:47:23.318699Z

๐Ÿงต I've been encountering a really pernicious bug that has something to do with clojure.test assertions involving certain Java objects, which makes tests *appear to pass when they actually fail*

cfleming 2026-05-08T22:52:47.862889Z

Thanks @mgardner2, I'll get this fixed for the next build.

MJ 2026-05-08T22:56:59.352459Z

thanks @cfleming. Is there any way to prevent this kind of false positive in general? IMO it shouldn't be possible for a crash to result in a failing test appearing to pass

MJ 2026-05-08T22:57:23.609089Z

but that might be an IntelliJ issue, idk

cfleming 2026-05-08T23:50:47.501649Z

I'm not sure, it's definitely not ideal obviously. Once I've investigated I'll have a better idea, and will try to make it so that errors in the test pipeline surface as errors rather than passes, even if the error is internal to Cursive and not from the test itself.

๐Ÿ‘ 2
MJ 2026-05-05T18:47:56.964139Z

reproducer: foo/Foo.java:

package foo;

import java.util.function.Predicate;

public interface Foo {
    Predicate 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})))

MJ 2026-05-05T18:49:01.369929Z

this results in a Cursive crash 100% of the time, but the test then appears to pass. I've submitted a couple crash reports already, but wanted to raise visibility since the outcome is so deceptive

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)
    ...

MJ 2026-05-05T19:08:43.779329Z

Cursive 2026.1-261 IntelliJ IDEA 2026.1.1 although it's been happening since at least the previous release of both

imre 2026-05-05T19:50:16.848229Z

> Cursive crash 100% of the time I'm interested in how this manifests

MJ 2026-05-05T20:07:30.049459Z

this is what you see when it crashes. Somewhat easy to miss, especially since it disappears about 10 seconds after any further interaction with the IDE

imre 2026-05-05T20:14:45.024429Z

ah, thank you

cfleming 2026-05-14T23:51:44.975979Z

https://github.com/cursive-ide/cursive/issues/3096