All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonTest.com.copperleaf.json.utils.TestListUtils.kt Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
package com.copperleaf.json.utils

import io.kotest.core.spec.style.FreeSpec
import io.kotest.matchers.shouldBe

class TestListUtils : FreeSpec({
    "takeHead - mapping" {
        listOf(1, 2, 3, 4, 5).takeHead() shouldBe (1 to listOf(2, 3, 4, 5))
    }
    "takeHead - with mapping" {
        listOf(1, 2, 3, 4, 5).takeHead { "$it" } shouldBe ("1" to listOf(2, 3, 4, 5))
    }
    "takeHead - multiple head elements" {
        listOf(1, 2, 3, 4, 5).takeHead(2) shouldBe (listOf(1, 2) to listOf(3, 4, 5))
    }
})




© 2015 - 2024 Weber Informatics LLC | Privacy Policy