formatting
This commit is contained in:
parent
30f5e2bb6c
commit
6a66125286
@ -24,19 +24,18 @@ class MatrixPatternsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `given user id cases, when checking isUserId, then returns expected`() {
|
fun `given user id cases, when checking isUserId, then returns expected`() {
|
||||||
val cases = listOf(
|
val cases = listOf(
|
||||||
UserIdCase("foobar", isUserId = false),
|
UserIdCase("foobar", isUserId = false),
|
||||||
UserIdCase("@foobar", isUserId = false),
|
UserIdCase("@foobar", isUserId = false),
|
||||||
UserIdCase("foobar@matrix.org", isUserId = false),
|
UserIdCase("foobar@matrix.org", isUserId = false),
|
||||||
UserIdCase("@foobar: matrix.org", isUserId = false),
|
UserIdCase("@foobar: matrix.org", isUserId = false),
|
||||||
UserIdCase("@foobar:matrix.org", isUserId = true),
|
UserIdCase("@foobar:matrix.org", isUserId = true),
|
||||||
)
|
)
|
||||||
|
|
||||||
cases.forEach { (input, expected) ->
|
cases.forEach { (input, expected) ->
|
||||||
MatrixPatterns.isUserId(input) shouldBeEqualTo expected
|
MatrixPatterns.isUserId(input) shouldBeEqualTo expected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private data class UserIdCase(val input: String, val isUserId: Boolean)
|
private data class UserIdCase(val input: String, val isUserId: Boolean)
|
||||||
|
Loading…
Reference in New Issue
Block a user