diff options
Diffstat (limited to 'src/main/kotlin/util/TestUtil.kt')
-rw-r--r-- | src/main/kotlin/util/TestUtil.kt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main/kotlin/util/TestUtil.kt b/src/main/kotlin/util/TestUtil.kt index 2d38f35..45e3dde 100644 --- a/src/main/kotlin/util/TestUtil.kt +++ b/src/main/kotlin/util/TestUtil.kt @@ -1,6 +1,7 @@ package moe.nea.firmament.util object TestUtil { + inline fun <T> unlessTesting(block: () -> T): T? = if (isInTest) null else block() val isInTest = Thread.currentThread().stackTrace.any { it.className.startsWith("org.junit.") || it.className.startsWith("io.kotest.") |