2024-01-29 23:17:50 +00:00
|
|
|
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())))
|
2024-01-29 23:17:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[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))
|
2024-01-29 23:17:50 +00:00
|
|
|
);
|
|
|
|
}
|