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

jvmTest.tech.skot.core.view.TestSKSpannedStringBuilder.kt Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
package tech.skot.core.view

import org.junit.Test
import kotlin.test.assertEquals

class TestSKSpannedStringBuilder {


    @Test
    fun testSimple() {

        val res = skSpannedString {
            colored(ColorRef(1)) {
                append("coucou")
                underline {
                    colored(ColorHex("#123456")) {
                        append("jaune")
                    }
                    striked {
                        append("rouge encore")
                    }
                }

            }

        }
        println(res)

    }

    @Test
    fun testUnderline() {

        assertEquals(
            expected = listOf(SKSpan(text = "test1", underline = true)),
            actual = skSpannedString {
                underline {
                    append("test1")
                }
            }
        )
    }

    @Test
    fun testStriked() {

        assertEquals(
            expected = listOf(SKSpan(text = "test1", striked = true)),
            actual = skSpannedString {
                striked {
                    append("test1")
                }
            }
        )
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy