forked from kscience/kmath
Add more test for ASM const product
This commit is contained in:
parent
6686144538
commit
a2e33bf6d8
@ -66,6 +66,30 @@ class AsmTest {
|
|||||||
mapOf("x" to 5.0)
|
mapOf("x" to 5.0)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testCProductWithOtherTypeNumber() = testDoubleExpressionValue(
|
||||||
|
25.0,
|
||||||
|
AsmConstProductExpression(AsmVariableExpression("x"), 5f),
|
||||||
|
mapOf("x" to 5.0)
|
||||||
|
)
|
||||||
|
|
||||||
|
object CustomZero : Number() {
|
||||||
|
override fun toByte(): Byte = 0
|
||||||
|
override fun toChar(): Char = 0.toChar()
|
||||||
|
override fun toDouble(): Double = 0.0
|
||||||
|
override fun toFloat(): Float = 0f
|
||||||
|
override fun toInt(): Int = 0
|
||||||
|
override fun toLong(): Long = 0L
|
||||||
|
override fun toShort(): Short = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testCProductWithCustomTypeNumber() = testDoubleExpressionValue(
|
||||||
|
0.0,
|
||||||
|
AsmConstProductExpression(AsmVariableExpression("x"), CustomZero),
|
||||||
|
mapOf("x" to 5.0)
|
||||||
|
)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testVar() = testDoubleExpressionValue(
|
fun testVar() = testDoubleExpressionValue(
|
||||||
10000.0,
|
10000.0,
|
||||||
|
Loading…
Reference in New Issue
Block a user