diff options
Diffstat (limited to '')
-rw-r--r-- | askama_test/templates/simple.html | 5 | ||||
-rw-r--r-- | askama_test/tests/simple.rs | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/askama_test/templates/simple.html b/askama_test/templates/simple.html index e544306..51e225b 100644 --- a/askama_test/templates/simple.html +++ b/askama_test/templates/simple.html @@ -1 +1,4 @@ -hello world, {{ var }} +hello world, {{ strvar }} +with number: {{ num }} +Iñtërnâtiônàlizætiøn is important +in vars too: {{ i18n }} diff --git a/askama_test/tests/simple.rs b/askama_test/tests/simple.rs index 9dbfc9c..08b4488 100644 --- a/askama_test/tests/simple.rs +++ b/askama_test/tests/simple.rs @@ -9,11 +9,20 @@ use askama::Template; #[derive(Template)] #[template(path = "simple.html")] struct TestTemplate { - var: String, + strvar: String, + num: i64, + i18n: String, } #[test] fn it_works() { - let s = TestTemplate { var: "foo".to_string() }.render(); - assert_eq!(s, "hello world, foo\n"); + let s = TestTemplate { + strvar: "foo".to_string(), + num: 42, + i18n: "Iñtërnâtiônàlizætiøn".to_string(), + }; + assert_eq!(s.render(), "hello world, foo\n\ + with number: 42\n\ + Iñtërnâtiônàlizætiøn is important\n\ + in vars too: Iñtërnâtiônàlizætiøn\n"); } |