mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Add ability to clear or toggle formatting.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2023 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.thoughtcrime.securesms
|
||||
|
||||
import org.hamcrest.MatcherAssert
|
||||
import org.hamcrest.Matchers
|
||||
|
||||
fun <T : Any?> T.assertIsNull() {
|
||||
MatcherAssert.assertThat(this, Matchers.nullValue())
|
||||
}
|
||||
|
||||
fun <T : Any?> T.assertIsNotNull() {
|
||||
MatcherAssert.assertThat(this, Matchers.notNullValue())
|
||||
}
|
||||
|
||||
infix fun <T : Any?> T.assertIs(expected: T) {
|
||||
MatcherAssert.assertThat(this, Matchers.`is`(expected))
|
||||
}
|
||||
|
||||
infix fun <T : Any> T.assertIsNot(expected: T) {
|
||||
MatcherAssert.assertThat(this, Matchers.not(Matchers.`is`(expected)))
|
||||
}
|
||||
|
||||
infix fun <E, T : Collection<E>> T.assertIsSize(expected: Int) {
|
||||
MatcherAssert.assertThat(this, Matchers.hasSize(expected))
|
||||
}
|
||||
Reference in New Issue
Block a user