formatting

This commit is contained in:
Adam Brown 2022-06-16 11:19:14 +01:00
parent 30f5e2bb6c
commit 6a66125286

View file

@ -24,19 +24,18 @@ class MatrixPatternsTest {
@Test
fun `given user id cases, when checking isUserId, then returns expected`() {
val cases = listOf(
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 = true),
)
val cases = listOf(
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 = true),
)
cases.forEach { (input, expected) ->
MatrixPatterns.isUserId(input) shouldBeEqualTo expected
}
cases.forEach { (input, expected) ->
MatrixPatterns.isUserId(input) shouldBeEqualTo expected
}
}
}
private data class UserIdCase(val input: String, val isUserId: Boolean)