diff options
Diffstat (limited to '')
-rw-r--r-- | testing/templates/precedence.html | 7 | ||||
-rw-r--r-- | testing/tests/precedence.rs | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/testing/templates/precedence.html b/testing/templates/precedence.html new file mode 100644 index 0000000..e5d12dd --- /dev/null +++ b/testing/templates/precedence.html @@ -0,0 +1,7 @@ +{{ 3 * 4 / 2 -}} +{{ 26 / 2 % 7 -}} +{{ 3 % 2 * 6 -}} +{{ 1 * 2 + 4 -}} +{{ 11 - 15 / 3 -}} +{{ 4 + 5 % 3 -}} +{{ 4 | 2 + 5 & 2 -}} diff --git a/testing/tests/precedence.rs b/testing/tests/precedence.rs new file mode 100644 index 0000000..f02189d --- /dev/null +++ b/testing/tests/precedence.rs @@ -0,0 +1,15 @@ +#[macro_use] +extern crate askama; + +use askama::Template; + +#[derive(Template)] +#[template(path = "precedence.html")] +struct PrecedenceTemplate { +} + +#[test] +fn test_precedence() { + let t = PrecedenceTemplate { }; + assert_eq!(t.render().unwrap(), "6".repeat(7)); +} |