kotest-assertions-core / io.kotest.matchers.string / kotlin.String

Extensions for kotlin.String

shouldBeBlank

fun String?.shouldBeBlank(): Unit

shouldBeEmpty

fun String?.shouldBeEmpty(): Unit

shouldBeEqualIgnoringCase

Asserts that this is equal to other (ignoring case)

infix fun String?.shouldBeEqualIgnoringCase(other: String): Unit

shouldBeFalsy

Assert that string should be falsy.

fun String?.shouldBeFalsy(): Unit

shouldBeInteger

fun String?.shouldBeInteger(radix: Int = 10): Int

shouldBeLowerCase

fun String?.shouldBeLowerCase(): Unit

shouldBeSingleLine

fun String?.shouldBeSingleLine(): Unit

shouldBeTruthy

Assert that string should be truthy.

fun String?.shouldBeTruthy(): Unit

shouldBeUpperCase

fun String?.shouldBeUpperCase(): Unit

shouldBeUUID

Asserts that this String is a valid UUID

fun String.shouldBeUUID(version: UUIDVersion = ANY, considerNilValid: Boolean = true): Unit

shouldContain

infix fun String?.shouldContain(regex: Regex): Unit
infix fun String?.shouldContain(substr: String): Unit

shouldContainADigit

fun String?.shouldContainADigit(): Unit

shouldContainIgnoringCase

infix fun String?.shouldContainIgnoringCase(substr: String): Unit

shouldContainInOrder

fun String?.shouldContainInOrder(vararg substrings: String): Unit

shouldContainOnlyDigits

fun String?.shouldContainOnlyDigits(): Unit

shouldContainOnlyOnce

infix fun String?.shouldContainOnlyOnce(substr: String): Unit

shouldEndWith

infix fun String?.shouldEndWith(suffix: String): Unit

shouldHaveDigest

fun String?.shouldHaveDigest(algo: String, digest: String): Unit

shouldHaveLength

infix fun String?.shouldHaveLength(length: Int): Unit

shouldHaveLengthBetween

fun String?.shouldHaveLengthBetween(min: Int, max: Int): Unit

shouldHaveLengthIn

fun String?.shouldHaveLengthIn(range: IntRange): Unit

shouldHaveLineCount

infix fun String?.shouldHaveLineCount(count: Int): Unit

shouldHaveMaxLength

infix fun String?.shouldHaveMaxLength(length: Int): Unit

shouldHaveMinLength

infix fun String?.shouldHaveMinLength(length: Int): Unit

shouldHaveSameLengthAs

infix fun String?.shouldHaveSameLengthAs(other: String): Unit

shouldInclude

infix fun String?.shouldInclude(substr: String): Unit

shouldMatch

infix fun String?.shouldMatch(regex: String): Unit
infix fun String?.shouldMatch(regex: Regex): Unit

shouldNotBeBlank

fun String?.shouldNotBeBlank(): Unit

shouldNotBeEmpty

fun String?.shouldNotBeEmpty(): Unit

shouldNotBeEqualIgnoringCase

Asserts that this is NOT equal to other (ignoring case)

infix fun String?.shouldNotBeEqualIgnoringCase(other: String): Unit

shouldNotBeLowerCase

fun String?.shouldNotBeLowerCase(): Unit

shouldNotBeSingleLine

fun String?.shouldNotBeSingleLine(): Unit

shouldNotBeUpperCase

fun String?.shouldNotBeUpperCase(): Unit

shouldNotBeUUID

Asserts that this String is NOT a valid UUID

fun String.shouldNotBeUUID(version: UUIDVersion = ANY, considerNilValid: Boolean = true): Unit

shouldNotContain

infix fun String?.shouldNotContain(regex: Regex): Unit
infix fun String?.shouldNotContain(substr: String): Unit

shouldNotContainADigit

fun String?.shouldNotContainADigit(): Unit

shouldNotContainIgnoringCase

infix fun String?.shouldNotContainIgnoringCase(substr: String): Unit

shouldNotContainInOrder

fun String?.shouldNotContainInOrder(vararg substrings: String): Unit

shouldNotContainOnlyDigits

fun String?.shouldNotContainOnlyDigits(): Unit

shouldNotContainOnlyOnce

infix fun String?.shouldNotContainOnlyOnce(substr: String): Unit

shouldNotEndWith

infix fun String?.shouldNotEndWith(suffix: String): Unit

shouldNotHaveDigest

fun String?.shouldNotHaveDigest(algo: String, digest: String): Unit

shouldNotHaveLength

infix fun String?.shouldNotHaveLength(length: Int): Unit

shouldNotHaveLengthBetween

fun String?.shouldNotHaveLengthBetween(min: Int, max: Int): Unit

shouldNotHaveLengthIn

fun String?.shouldNotHaveLengthIn(range: IntRange): Unit

shouldNotHaveLineCount

infix fun String?.shouldNotHaveLineCount(count: Int): Unit

shouldNotHaveMaxLength

infix fun String?.shouldNotHaveMaxLength(length: Int): Unit

shouldNotHaveMinLength

infix fun String?.shouldNotHaveMinLength(length: Int): Unit

shouldNotHaveSameLengthAs

infix fun String?.shouldNotHaveSameLengthAs(other: String): Unit

shouldNotInclude

infix fun String?.shouldNotInclude(substr: String): Unit

shouldNotMatch

infix fun String?.shouldNotMatch(regex: String): Unit

shouldNotStartWith

infix fun String?.shouldNotStartWith(prefix: String): Unit

shouldStartWith

infix fun String?.shouldStartWith(prefix: String): Unit