mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 18:00:33 +08:00
DSL for testing
This commit is contained in:
parent
b50a6259d4
commit
569e69b062
@ -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> E.shouldBeEqualTo(another: E) = assertEquals(another, this)
|
||||
|
||||
@TestDSL
|
||||
inline infix fun <E> E.shouldNotBeEqualTo(another: E) = assertNotEquals(another, this)
|
Loading…
Reference in New Issue
Block a user