1
//! LET / LET* with runtime-valued bindings. The legacy tests injected
2
//! an `Expr::WasmRuntime(Ratio)` symbol for `X`; the rewritten tests
3
//! bind `X` from a real host fn via `wrap_with_runtime_ratio` so the
4
//! bind_runtime_or_const promotion path actually runs.
5

            
6
use super::common::{compile_and_validate, wrap_with_runtime_ratio};
7

            
8
#[test]
9
1
fn let_star_single_runtime_binding() {
10
1
    compile_and_validate(&wrap_with_runtime_ratio("(let* ((Y (+ X 1))) (+ Y 2))"));
11
1
}
12

            
13
#[test]
14
1
fn let_star_multiple_runtime_bindings() {
15
1
    compile_and_validate(&wrap_with_runtime_ratio(
16
1
        "(let* ((Y (+ X 1)) (Z (* Y 2))) (- Z X))",
17
1
    ));
18
1
}
19

            
20
#[test]
21
1
fn let_star_runtime_then_if() {
22
1
    compile_and_validate(&wrap_with_runtime_ratio(
23
1
        "(let* ((Y (+ X 1))) (if (= Y 0) (+ Y 1) (- Y 1)))",
24
1
    ));
25
1
}