aboutsummaryrefslogtreecommitdiffstats
path: root/src/parse/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/test.rs')
-rw-r--r--src/parse/test.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/parse/test.rs b/src/parse/test.rs
new file mode 100644
index 0000000..6cd7793
--- /dev/null
+++ b/src/parse/test.rs
@@ -0,0 +1,16 @@
+use super::*;
+
+fn parse(x: &[u8]) -> Ast<PreExpansion> {
+ do_parse(x).unwrap()
+}
+
+#[test]
+fn command_interp() {
+ assert_eq!(
+ parse(br#"echo "$(echo hi)""#),
+ pipes([cmd([
+ estr(b"echo"),
+ str([cmdp(pipes([cmd([estr(b"echo"), estr(b"hi")]),])),])
+ ]),])
+ );
+}