From f9db4446d5325b1cd6fa6154a7630e5138b61975 Mon Sep 17 00:00:00 2001 From: vallentin Date: Sat, 2 Jan 2021 23:55:46 +0100 Subject: Added copy literals related test case --- testing/tests/loops.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/testing/tests/loops.rs b/testing/tests/loops.rs index 4345b4f..809f75e 100644 --- a/testing/tests/loops.rs +++ b/testing/tests/loops.rs @@ -91,6 +91,18 @@ fn test_for_method_call() { assert_eq!(t.render().unwrap(), "123"); } +#[derive(Template)] +#[template( + source = "{% for i in ::std::iter::repeat(\"a\").take(5) %}{{ i }}{% endfor %}", + ext = "txt" +)] +struct ForPathCallTemplate; + +#[test] +fn test_for_path_call() { + assert_eq!(ForPathCallTemplate.render().unwrap(), "aaaaa"); +} + #[derive(Template)] #[template( source = "{% for i in [1, 2, 3, 4, 5][3..] %}{{ i }}{% endfor %}", -- cgit