diff options
Diffstat (limited to 'askama_parser/src/tests.rs')
-rw-r--r-- | askama_parser/src/tests.rs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/askama_parser/src/tests.rs b/askama_parser/src/tests.rs index 5b3b66e..2beeb38 100644 --- a/askama_parser/src/tests.rs +++ b/askama_parser/src/tests.rs @@ -493,9 +493,34 @@ fn test_odd_calls() { Ast::from_str("{{ -a(b) }}", &syntax).unwrap().nodes, vec![Node::Expr( Ws(None, None), - Unary("-", Box::new(Call(Box::new(Var("a")), vec![Var("b")])),), + Unary("-", Box::new(Call(Box::new(Var("a")), vec![Var("b")]))), )], ); + assert_eq!( + Ast::from_str("{{ a(b)|c }}", &syntax).unwrap().nodes, + vec![Node::Expr( + Ws(None, None), + Filter("c", vec![Call(Box::new(Var("a")), vec![Var("b")])]), + )] + ); + assert_eq!( + Ast::from_str("{{ a(b)| c }}", &syntax).unwrap().nodes, + vec![Node::Expr( + Ws(None, None), + Filter("c", vec![Call(Box::new(Var("a")), vec![Var("b")])]), + )] + ); + assert_eq!( + Ast::from_str("{{ a(b) |c }}", &syntax).unwrap().nodes, + vec![Node::Expr( + Ws(None, None), + BinOp( + "|", + Box::new(Call(Box::new(Var("a")), vec![Var("b")])), + Box::new(Var("c")) + ), + )] + ); } #[test] |