Ir al contenido principal
Versión: 5.8.x

Arrow

[Traducción Beta No Oficial]

Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →

Latest Release

Esta página enumera todos los matchers disponibles actualmente en la biblioteca de extensiones de Kotest para Arrow.

nota

Se requiere el siguiente módulo: io.kotest.extensions:kotest-assertions-arrow, cuya versión es independiente del proyecto principal de Kotest. Consulta la última versión en Maven Central aquí.

nota

Si io.arrow-kt:arrow-core:arrow-version no está en tu classpath, añádelo para evitar errores de referencia no resuelta.

Option
option.shouldBeSome()Asserts that the option is of type Some and returns value
option.shouldBeSome(v)Asserts that the option is of type Some with value v
option.shouldBeNone()Asserts that the option is of type None
Either
either.shouldBeRight()Asserts that the either is of type Right and returns the Right value
either.shouldBeRight(v)Asserts that the either is of type Right with specified value v
either.shouldBeLeft()Asserts that the either is of type Left and returns the Left value
either.shouldBeLeft(v)Asserts that the either is of type Left with specific value v
NonEmptyList
nel.shouldContain(e)Asserts that the NonEmptyList contains the given element e
nel.shouldContainAll(e1,e2,...,en)Asserts that the NonEmptyList contains all the given elements e1,e2,...,en
nel.shouldContainNull()Asserts that the NonEmptyList contains at least one null
nel.shouldContainNoNulls()Asserts that the NonEmptyList contains no nulls
nel.shouldContainOnlyNulls()Asserts that the NonEmptyList contains only nulls or is empty
nel.shouldHaveDuplicates()Asserts that the NonEmptyList has at least one duplicate
nel.shouldBeSingleElement(e)Asserts that the NonEmptyList has a single element which is e
nel.shouldBeSorted()Asserts that the NonEmptyList is sorted
Validated
validated.shouldBeValid()Asserts that the validated is of type Valid and returns the Valid value
validated.shouldBeValid(v)Asserts that the validated is of type Valid with specific value v
validated.shouldBeInvalid()Asserts that the validated is of type Invalid and returns the Invalid value
validated.shouldBeInvalid(v)Asserts that the validated is of type Invalid with specific value v