forked from kscience/kmath
Add tests for MapInstrinsics
This commit is contained in:
parent
5ab6960e9b
commit
90c287d42f
@ -0,0 +1,22 @@
|
||||
package scietifik.kmath.asm
|
||||
|
||||
import scientifik.kmath.ast.mstInRing
|
||||
import scientifik.kmath.expressions.invoke
|
||||
import scientifik.kmath.operations.ByteRing
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertFailsWith
|
||||
|
||||
internal class TestAsmVariables {
|
||||
@Test
|
||||
fun testVariableWithoutDefault() {
|
||||
val expr = ByteRing.mstInRing { symbol("x") }
|
||||
assertEquals(1.toByte(), expr("x" to 1.toByte()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testVariableWithoutDefaultFails() {
|
||||
val expr = ByteRing.mstInRing { symbol("x") }
|
||||
assertFailsWith<IllegalStateException> { expr() }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user