Implemented subshells and improved error handling

This commit is contained in:
2025-03-29 22:16:26 -04:00
parent a16ad981bc
commit ed05e34379
15 changed files with 222 additions and 35 deletions

View File

@@ -5,7 +5,7 @@ use super::*;
#[test]
fn simple_expansion() {
let varsub = "$foo";
write_vars(|v| v.set_var("foo", "this is the value of the variable".into()));
write_vars(|v| v.set_var("foo", "this is the value of the variable".into(), false));
let mut tokens: Vec<Tk> = LexStream::new(Arc::new(varsub.to_string()), LexFlags::empty())
.map(|tk| tk.unwrap())
@@ -14,7 +14,7 @@ fn simple_expansion() {
let var_tk = tokens.pop().unwrap();
let var_span = var_tk.span.clone();
let exp_tk = var_tk.expand(var_span, TkFlags::empty()).unwrap();
let exp_tk = var_tk.expand().unwrap();
write_vars(|v| v.vars_mut().clear());
insta::assert_debug_snapshot!(exp_tk.get_words())
}