diff --git a/mirai-core/src/commonTest/kotlin/net.mamoe.mirai.test/TestDSL.kt b/mirai-core/src/commonTest/kotlin/net.mamoe.mirai.test/TestDSL.kt new file mode 100644 index 000000000..ae5b961ae --- /dev/null +++ b/mirai-core/src/commonTest/kotlin/net.mamoe.mirai.test/TestDSL.kt @@ -0,0 +1,23 @@ +@file:Suppress("NOTHING_TO_INLINE") + +package net.mamoe.mirai.test + +import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertNotEquals +import kotlin.test.assertTrue + +@DslMarker +internal annotation class TestDSL + +@TestDSL +inline fun Boolean.shouldBeTrue() = assertTrue { this } + +@TestDSL +inline fun Boolean.shouldBeFalse() = assertFalse { this } + +@TestDSL +inline infix fun E.shouldBeEqualTo(another: E) = assertEquals(another, this) + +@TestDSL +inline infix fun E.shouldNotBeEqualTo(another: E) = assertNotEquals(another, this)