1
0
dust/tests/expressions.rs

17 lines
363 B
Rust
Raw Normal View History

2024-03-07 03:15:35 +00:00
use dust_lang::*;
#[test]
fn logic() {
assert_eq!(interpret("1 == 1"), Ok(Value::boolean(true)));
assert_eq!(
interpret("('42' == '42') && (42 != 0)"),
Ok(Value::boolean(true))
);
}
2024-03-07 10:37:26 +00:00
#[test]
fn math() {
assert_eq!(interpret("1 + 1"), Ok(Value::integer(2)));
assert_eq!(interpret("21 + 19 + 1 * 2"), Ok(Value::integer(42)));
}