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