Improve tests

This commit is contained in:
Iaroslav Postovalov 2021-01-07 02:45:37 +07:00
parent ff930532e0
commit 57328a176e
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7
2 changed files with 8 additions and 2 deletions

View File

@ -3,11 +3,17 @@ package kscience.kmath.gsl
import kotlin.test.Test
import kotlin.test.assertEquals
internal class GslMatrixTest {
internal class GslMatrixRealTest {
@Test
fun dimensions() = GslRealMatrixContext {
val mat = produce(42, 24) { _, _ -> 0.0 }
assertEquals(42, mat.rowNum)
assertEquals(24, mat.colNum)
}
@Test
fun get() = GslRealMatrixContext {
val mat = produce(1, 1) { _, _ -> 42.0 }
assertEquals(42.0, mat[0, 0])
}
}

View File

@ -12,7 +12,7 @@ import kotlin.test.assertEquals
import kotlin.test.assertTrue
import kotlin.time.measureTime
internal class RealTest {
internal class GslRealContextTest {
@Test
fun testScale() = GslRealMatrixContext {
val ma = produce(10, 10) { _, _ -> 0.1 }