Lines
100 %
Functions
Branches
//! LET / LET* with runtime-valued bindings. The legacy tests injected
//! an `Expr::WasmRuntime(Ratio)` symbol for `X`; the rewritten tests
//! bind `X` from a real host fn via `wrap_with_runtime_ratio` so the
//! bind_runtime_or_const promotion path actually runs.
use super::common::{compile_and_validate, wrap_with_runtime_ratio};
#[test]
fn let_star_single_runtime_binding() {
compile_and_validate(&wrap_with_runtime_ratio("(let* ((Y (+ X 1))) (+ Y 2))"));
}
fn let_star_multiple_runtime_bindings() {
compile_and_validate(&wrap_with_runtime_ratio(
"(let* ((Y (+ X 1)) (Z (* Y 2))) (- Z X))",
));
fn let_star_runtime_then_if() {
"(let* ((Y (+ X 1))) (if (= Y 0) (+ Y 1) (- Y 1)))",