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.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parse/test.rs b/src/parse/test.rs
index 28cf4a2..ca57e75 100644
--- a/src/parse/test.rs
+++ b/src/parse/test.rs
@@ -86,3 +86,11 @@ fn set_variable_in_fun() {
decl(estr(b"setter"), assign(estr(b"x"), estr(b"1"))),
);
}
+
+#[test]
+fn variable_with_defaults() {
+ parse_test(
+ parse(b"${x:-y}"),
+ pipes([cmd([str([var_default(b"x", estr(b"y"))])])]),
+ );
+}