Skip to content

Commit

Permalink
Added numbers parser test
Browse files Browse the repository at this point in the history
  • Loading branch information
vallentin authored and djc committed Jan 5, 2021
1 parent c1f627d commit c2102d4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions askama_shared/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,19 @@ mod tests {
);
}

#[test]
fn test_parse_numbers() {
let syntax = Syntax::default();
assert_eq!(
super::parse("{{ 2 }}", &syntax).unwrap(),
vec![Node::Expr(WS(false, false), Expr::NumLit("2"),)],
);
assert_eq!(
super::parse("{{ 2.5 }}", &syntax).unwrap(),
vec![Node::Expr(WS(false, false), Expr::NumLit("2.5"),)],
);
}

#[test]
fn test_parse_var_call() {
assert_eq!(
Expand Down

0 comments on commit c2102d4

Please sign in to comment.