From 19e1cd8324f65aa07950e02a1aaac5b2fba9309b Mon Sep 17 00:00:00 2001 From: Sandipsinh Rathod <62684960+ssddOnTop@users.noreply.github.com> Date: Tue, 23 Apr 2024 10:32:36 +0530 Subject: [PATCH] chore(mustache): add tests for new mustache parsing (#1771) --- src/mustache.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mustache.rs b/src/mustache.rs index 7ced733c41..689ce0b36f 100644 --- a/src/mustache.rs +++ b/src/mustache.rs @@ -353,6 +353,19 @@ mod tests { Mustache::from(vec![Segment::Literal("test:{SHA}string".to_string())]) ); } + + #[test] + fn test_optional_dot_expression() { + let s = r"{{.foo.bar}}"; + let mustache: Mustache = Mustache::parse(s).unwrap(); + assert_eq!( + mustache, + Mustache::from(vec![Segment::Expression(vec![ + "foo".to_string(), + "bar".to_string(), + ])]) + ); + } } mod render {