1
0
dust/tests/commands.rs

15 lines
291 B
Rust
Raw Permalink Normal View History

use dust_lang::{interpret, Value};
#[test]
fn simple_command() {
2024-02-18 16:38:35 +00:00
assert_eq!(interpret("^echo hi"), Ok(Value::String("hi\n".to_string())))
}
#[test]
fn assign_command_output() {
assert_eq!(
2024-02-18 16:38:35 +00:00
interpret("x = ^ls; length(str:lines(x))"),
Ok(Value::Integer(11))
);
}