Skip to content

Commit

Permalink
Update CollectionsSyntaxTests.kt (#3273)
Browse files Browse the repository at this point in the history
* Update CollectionsSyntaxTests.kt

* Update CollectionsSyntaxTests.kt

---------

Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com>
Co-authored-by: Alejandro Serrano <trupill@gmail.com>
  • Loading branch information
3 people authored Nov 8, 2023
1 parent 99a8e49 commit 33adc3c
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@

package arrow.core

import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.shouldBe
import kotlin.test.Test
import kotlinx.coroutines.test.runTest

class CollectionsSyntaxTests : StringSpec({
"tail" {
class CollectionsSyntaxTests {
@Test fun tail() = runTest {
listOf(1, 2, 3).tail() shouldBe listOf(2, 3)
}

"prependTo" {
@Test fun prependTo() = runTest {
1 prependTo listOf(2, 3) shouldBe listOf(1, 2, 3)
}

"destructured" {
@Test fun destructured() = runTest {
val (head, tail) = listOf(1, 2, 3).let { it.first() to it.tail() }
head shouldBe 1
tail shouldBe listOf(2, 3)
}
})
}

0 comments on commit 33adc3c

Please sign in to comment.