From 82b885d8f12fc9ccb02a7e77799ced063d2df29e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 8 Jan 2022 14:40:57 -0500 Subject: more tests --- src/parse/ast.rs | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/parse/ast.rs b/src/parse/ast.rs index 55a71f4..3e67273 100644 --- a/src/parse/ast.rs +++ b/src/parse/ast.rs @@ -622,4 +622,51 @@ fn test_parts() { ) ) ); + parse_eq!( + "echo $HOME/bin", + c!( + "echo $HOME/bin", + p!( + "echo $HOME/bin", + e!(w!("echo"), w!(wpv!("HOME"), wpb!("/bin"))) + ) + ) + ); + parse_eq!( + "echo '$HOME/bin'", + c!( + "echo '$HOME/bin'", + p!("echo '$HOME/bin'", e!(w!("echo"), w!(wps!("$HOME/bin")))) + ) + ); + parse_eq!( + "echo \"foo\"\"bar\"", + c!( + "echo \"foo\"\"bar\"", + p!( + "echo \"foo\"\"bar\"", + e!(w!("echo"), w!(wpd!("foo"), wpd!("bar"))) + ) + ) + ); + parse_eq!( + "echo $foo$bar$baz", + c!( + "echo $foo$bar$baz", + p!( + "echo $foo$bar$baz", + e!(w!("echo"), w!(wpv!("foo"), wpv!("bar"), wpv!("baz"))) + ) + ) + ); + parse_eq!( + "perl -E'say \"foo\"'", + c!( + "perl -E'say \"foo\"'", + p!( + "perl -E'say \"foo\"'", + e!(w!("perl"), w!(wpb!("-E"), wps!("say \"foo\""))) + ) + ) + ); } -- cgit v1.2.3-54-g00ecf