You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to write a Clojure client that uses this library, but there are some parts that make that hard.
Hegel used to return a map that told you if the test passed, how many cases were executed, number of cases, how many were interesting, whether health checks failed, etc. I can't figure out how to get that information any more. Could we have a structure returned by Hegel.test()? Bonus points if it includes (e.g.) a map of labels to generated values for the minimal failing case(s).
It's not clear what the Consumer passed to test() should do. I'm guessing that any non-exceptional return value is a valid test case. Is it OK to throw any exception? Any throwable (e.g. InterruptedException?) Do the exceptions specifically need to be JUnit ones? Is there special JUnit state that Hegel relies on, or is it OK to construct and throw the exceptions ourselves?
Does Hegel do anything with the fields of the assertions thrown, or is it just a pass/fail signal?
Hegel takes over printing to stderr/stdout, which fights with other logging/printing and does not play well with concurrency. Having a return value for TestCase might fix this, but you might also consider having a Reporter interface with callbacks for various Hegel events.
It would be very helpful to have something like testCase.isFinal(), so you could do your own debugging/logging on the final cases.
Hi @aphyr! Sorry for the delay in getting back to you, was on holiday and somewhat overwhelmed with notifications when I got back and missed this until just now.
Definitely agreed that hegel-java should be usable as a library. I think probably rather than trying to make the current hegel-java frontend usable in that way, we want a dev.hegel.lowlevel or something like that which exposes something closer to the libhegel C API (with whatever Java niceties are required) for people to use from other JVM libraries, as I think there's significant tension between providing a good frontend and providing a good library for people to build frontends. This should resolve (1), (4), (5), (6) for you.
Yes right now any throwable is marked as interesting. There's nothing JUnit specific here, there's some optional JUnit integration, but Hegel works without it. Possibly we should be a bit more fine grained about this, but I'm not 100% sure what the right semantics are here.
It looks at type and line number thrown by to distinguish exceptions that probably come from different types of bug.
Oh that's tremendously helpful, thank you. And no rush, this is on my back burner too.
I don't know if you need to drop super far down--the generator library felt very nicely designed and was straightforward to adapt, (1) and (5) would be API compatible with the current Hegel.test(), and (4) could be provided as an option. I assume there's more cool stuff down in libhegel that might be nice, but those three things are, I think, the only blockers for hegel-clj. :-)
Er, just to be clear, hegel-clj doesn't really work right now--I'll need at least 1 and 4 to get that working. Might want to hold off on linking to it.
Yeah, just let me know when y'all have return values and an option to control the logging, and I'll get back to work on it. I think those are the big blockers.
Oh very cool, thank you! I've got a bunch of work to unwind at the moment, but I would like to come back to this and try it out soon. Keep hitting bugs where I think Hegel's shrinking would really help. :-)
Activity
DRMacIver commentedon Aug 13, 2026
Hi @aphyr! Sorry for the delay in getting back to you, was on holiday and somewhat overwhelmed with notifications when I got back and missed this until just now.
Definitely agreed that hegel-java should be usable as a library. I think probably rather than trying to make the current hegel-java frontend usable in that way, we want a dev.hegel.lowlevel or something like that which exposes something closer to the libhegel C API (with whatever Java niceties are required) for people to use from other JVM libraries, as I think there's significant tension between providing a good frontend and providing a good library for people to build frontends. This should resolve (1), (4), (5), (6) for you.
aphyr commentedon Aug 13, 2026
Oh that's tremendously helpful, thank you. And no rush, this is on my back burner too.
I don't know if you need to drop super far down--the generator library felt very nicely designed and was straightforward to adapt, (1) and (5) would be API compatible with the current
Hegel.test(), and (4) could be provided as an option. I assume there's more cool stuff down in libhegel that might be nice, but those three things are, I think, the only blockers for hegel-clj. :-)Liam-DeVoe commentedon Aug 14, 2026
(added hegel-clj to the website! hegeldev/website#94)
aphyr commentedon Aug 17, 2026
Er, just to be clear, hegel-clj doesn't really work right now--I'll need at least 1 and 4 to get that working. Might want to hold off on linking to it.
Liam-DeVoe commentedon Aug 17, 2026
ah ok! I'll remove it, happy to add it back whenever you feel it's ready
aphyr commentedon Aug 17, 2026
Yeah, just let me know when y'all have return values and an option to control the logging, and I'll get back to work on it. I think those are the big blockers.
aphyr commentedon Sep 17, 2026
Oh very cool, thank you! I've got a bunch of work to unwind at the moment, but I would like to come back to this and try it out soon. Keep hitting bugs where I think Hegel's shrinking would really help. :-)
Fix stale docs and copy on website (#98)
claude: remove hegel-clj from community libraries
Fix stale docs and copy on website (#98)