1
0
dust/tests/statements.rs

21 lines
360 B
Rust
Raw Normal View History

2024-03-08 17:24:11 +00:00
use dust_lang::*;
#[test]
fn loops_and_breaks() {
assert_eq!(
interpret(
"
i = 0;
loop {
if i == 3 {
break 'foobar'
} else {
i += 1
}
}
"
),
Ok(Some(Value::string("foobar")))
)
}