atrium
atrium copied to clipboard
Add lazy message variants for because, feature, Untranslatable, etc
Code related feature
Currently, atrium forces early string instantiation, which does not play nicely with adding descriptions lazily
It would be nice to have something like
expect(2)
.because { "lazy $message" }
.toEqual(4)
// For usage like _logic.manualFeature(LazyUntranslatable(messageSupplier), ...
class LazyUntranslatable(
private val representation: () -> String
): Translatable {
override val name: String
get() = getDefault()
override fun getDefault(): String = representation.invoke()
}
we had this once for feature but dropped it because the performance win you get is most likely insignificant compared to test setup etc.
readable tests and less overloads in the API seemed more important to us.
Hence, what is your use case that you want it?