diff --git a/src/parser/shell_expand/mod.rs b/src/parser/shell_expand/mod.rs
index 77d6bdf3af96ff35266d13a4ec6ceba812abf270..09299bde5208aaa76a55c92a7d1f8d870f490edc 100644
--- a/src/parser/shell_expand/mod.rs
+++ b/src/parser/shell_expand/mod.rs
@@ -679,4 +679,15 @@ mod test {
         let expected = array!["3"];
         assert_eq!(expected, expand_string(line, &functions!(), false));
     }
+
+    #[test]
+    fn inline_expression() {
+        let cases = vec![
+            (array!["5"], "@len([0 1 2 3 4])"),
+            (array!["FxOxO"], "$join(@chars(FOO), 'x')")
+        ];
+        for (expected, input) in cases {
+            assert_eq!(expected, expand_string(input, &functions!(), false));
+        }
+    }
 }