Feat: demo songs

This commit is contained in:
2026-02-22 23:50:35 +01:00
parent 81f475a75b
commit f47285385c
27 changed files with 25324 additions and 38 deletions

View File

@@ -210,3 +210,47 @@ fn shorthand_float() {
fn shorthand_float_negative() {
expect_float("-.5 1 +", 0.5);
}
// linmap
#[test]
fn linmap_basic() {
expect_float("64 0 127 200 2000 linmap", 200.0 + (64.0 / 127.0) * 1800.0);
}
#[test]
fn linmap_at_bounds() {
expect_float("0 0 127 200 2000 linmap", 200.0);
}
#[test]
fn linmap_at_upper() {
expect_float("127 0 127 200 2000 linmap", 2000.0);
}
#[test]
fn linmap_equal_input_range() {
expect_float("5 5 5 100 200 linmap", 100.0);
}
// expmap
#[test]
fn expmap_at_zero() {
expect_float("0 200 8000 expmap", 200.0);
}
#[test]
fn expmap_at_one() {
expect_float("1 200 8000 expmap", 8000.0);
}
#[test]
fn expmap_midpoint() {
expect_float("0.5 100 10000 expmap", 1000.0);
}
#[test]
fn expmap_negative_bound() {
expect_error("0.5 -100 8000 expmap", "expmap requires positive bounds");
}