[orx-fcurve] improve handling of absolute hold command

This commit is contained in:
Edwin Jakobs
2024-05-09 10:41:27 +02:00
parent 4c086d9ff9
commit 15e1b4b04a
3 changed files with 28 additions and 14 deletions

View File

@@ -16,4 +16,20 @@ class TestFCurve {
assertEquals(10.5, normalizedSampler(1.0))
assertEquals(10.5, normalizedSampler(-1.0))
}
@Test
fun testAbsoluteHold() {
run {
val text = "H-1 L 5 5"
val fc = fcurve(text)
assertEquals(0.0, fc.value(-1.0))
assertEquals(5.0, fc.value(4.0))
}
run {
val text = "H1 L 5 5"
val fc = fcurve(text)
assertEquals(0.0, fc.value(1.0))
assertEquals(5.0, fc.value(6.0))
}
}
}