BorderCropTransformationTest.kt
composeApp/src/skikoTest/kotlin/eu/friedcutlet/yokan/ui/screens/reader/BorderCropTransformationTest.kt
1package eu.friedcutlet.yokan.ui.screens.reader23import coil3.size.Size4import kotlin.test.Test5import kotlin.test.assertEquals6import kotlinx.coroutines.test.runTest7import org.jetbrains.skia.Bitmap8import org.jetbrains.skia.IRect910class BorderCropTransformationTest {11 @Test12 fun transformationReturnsDetectedContentSubset() = runTest {13 val input = Bitmap().apply {14 check(allocN32Pixels(5, 4))15 erase(0xFFFFFFFF.toInt())16 erase(0xFF808080.toInt(), IRect.makeXYWH(1, 1, 3, 2))17 }1819 val result = createBorderCropTransformation().transform(input, Size.ORIGINAL)2021 assertEquals(3, result.width)22 assertEquals(2, result.height)23 assertEquals(0xFF808080.toInt(), result.getColor(0, 0))24 }25}26