1
0
dust/tests/while.rs

15 lines
275 B
Rust
Raw Permalink Normal View History

2024-01-06 07:26:51 +00:00
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))
)
}