ota4j-team / opentest4j

Open Test Alliance for the JVM
Apache License 2.0
285 stars 37 forks source link

Power Assertions for Java #47

Open stokito opened 6 years ago

stokito commented 6 years ago

Please take this project too under your umbrella https://github.com/jkschneider/java-power-assert I can't tell you exactly what it may need to change but it's better to notify authors

kcooney commented 6 years ago

Sorry, I am not quite sure what you are requesting here.

vlsi commented 1 year ago

@kcooney , I've described a couple of cases in the following issues:

For opentest4j, it might be relevant for ValueWrapper:

https://github.com/ota4j-team/opentest4j/blob/56860b5c4e0e5abee07568c496b2a85d75ce00cb/src/main/java/org/opentest4j/ValueWrapper.java#L84

Currently, the user has to provide stringRepresentation manually. However, when no stringRepresentation is provided, the compiler could infer and provide a decent fallback. For instance, suppose the user writes ValueWrapper.create(resultSet.next()), and the compiler transforms it into ValueWrapper(resultSet.next(), "resultSet.next()").

Then users get better-than-nothing representations while they still write tests as usual. Of course, it won't completely replace human-provided messages, however, it would still be helpful.