MicroUtils/matrix/src/commonTest/kotlin/dev/inmo/micro_utils/matrix/SimpleTest.kt

45 lines
1015 B
Kotlin
Raw Normal View History

2021-02-11 09:05:11 +00:00
package dev.inmo.micro_utils.matrix
import kotlin.test.Test
import kotlin.test.assertEquals
class SimpleTest {
@Test
fun simpleTest() {
val expected = listOf(
listOf(1, 2, 3),
listOf(4, 5, 6)
)
val fromMatrixWithVarargs = matrix<Int> {
row(1, 2, 3)
row(4, 5, 6)
}
val fromMatrixWithColumnsVarargs = matrix<Int> {
row {
columns(1, 2, 3)
}
row {
columns(4, 5, 6)
}
}
val fromMatrixWithSimpleAdd = matrix<Int> {
row {
2021-02-11 09:12:21 +00:00
column(1)
column(2)
column(3)
2021-02-11 09:05:11 +00:00
}
row {
2021-02-11 09:12:21 +00:00
column(4)
column(5)
column(6)
2021-02-11 09:05:11 +00:00
}
}
assertEquals(expected, fromMatrixWithVarargs)
assertEquals(expected, fromMatrixWithColumnsVarargs)
assertEquals(expected, fromMatrixWithSimpleAdd)
}
}