1
0
dust/tests/while.rs
2024-01-06 02:26:51 -05:00

15 lines
275 B
Rust

use dust_lang::*;
#[test]
fn while_loop() {
assert_eq!(interpret("while false { 'foo' }"), Ok(Value::Option(None)))
}
#[test]
fn while_loop_iteration_count() {
assert_eq!(
interpret("i = 0; while i < 3 { i += 1 }; i"),
Ok(Value::Integer(3))
)
}