aboutsummaryrefslogtreecommitdiffstats
path: root/askama_parser/src/tests.rs
diff options
context:
space:
mode:
authorLibravatar René Kijewski <rene.kijewski@fu-berlin.de>2023-08-01 03:45:32 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-08-01 13:04:41 +0200
commit7b7c38b37785b83ce28f1cc5f6e89abb89672276 (patch)
treea16abd0f5e877184837adc032db0d3e0cf66b978 /askama_parser/src/tests.rs
parent26f598c0d189769952b11ea9fe6168718f403590 (diff)
downloadaskama-7b7c38b37785b83ce28f1cc5f6e89abb89672276.tar.gz
askama-7b7c38b37785b83ce28f1cc5f6e89abb89672276.tar.bz2
askama-7b7c38b37785b83ce28f1cc5f6e89abb89672276.zip
parser: add type for `Node::Lit`
Diffstat (limited to '')
-rw-r--r--askama_parser/src/tests.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/askama_parser/src/tests.rs b/askama_parser/src/tests.rs
index 61aa279..4717652 100644
--- a/askama_parser/src/tests.rs
+++ b/askama_parser/src/tests.rs
@@ -1,16 +1,10 @@
-use super::{Ast, Expr, Node, Syntax, Whitespace, Ws};
+use super::{Ast, Expr, Lit, Node, Syntax, Whitespace, Ws};
fn check_ws_split(s: &str, res: &(&str, &str, &str)) {
- match super::split_ws_parts(s) {
- Node::Lit(lws, s, rws) => {
- assert_eq!(lws, res.0);
- assert_eq!(s, res.1);
- assert_eq!(rws, res.2);
- }
- _ => {
- panic!("fail");
- }
- }
+ let Lit { lws, val, rws } = Lit::split_ws_parts(s);
+ assert_eq!(lws, res.0);
+ assert_eq!(val, res.1);
+ assert_eq!(rws, res.2);
}
#[test]