https://kotlinlang.org logo
Title
a

Andrew Gazelka

03/02/2019, 12:42 AM
is it just me or is
assert
dead? From what I see on Google it isn't even enabled by default in junit unit tests afaik
n

natpryce

03/02/2019, 7:33 AM
You need to run the JVM with runtime assertions enabled for assert to do anything. They are intended for use in main code rather than tests, because a test that didn’t run its assertions would be pointless and, worse, give false confidence about its results. The kotlin.test package defines assertion functions for use in tests. https://kotlinlang.org/api/latest/kotlin.test/kotlin.test/index.html#functions