diff options
author | max <gmx.sht@gmail.com> | 2023-12-13 15:33:34 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-12-13 16:47:02 +0100 |
commit | 28182a1549a6546750d3f9834cb35686b89c3cf9 (patch) | |
tree | 76c1eca645646b1d18a32175a20d166b82a4a5b7 /testing/tests | |
parent | e4b8ca3c44b5ede192700d0e4c9ed1c58338c1b6 (diff) | |
download | askama-28182a1549a6546750d3f9834cb35686b89c3cf9.tar.gz askama-28182a1549a6546750d3f9834cb35686b89c3cf9.tar.bz2 askama-28182a1549a6546750d3f9834cb35686b89c3cf9.zip |
Bugfix in `is_attr_self()`
Signed-off-by: max <gmx.sht@gmail.com>
Diffstat (limited to 'testing/tests')
-rw-r--r-- | testing/tests/calls.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/tests/calls.rs b/testing/tests/calls.rs index 052f34f..28d7491 100644 --- a/testing/tests/calls.rs +++ b/testing/tests/calls.rs @@ -80,3 +80,22 @@ fn test_one_func_binop() { }; assert_eq!(t.render().unwrap(), "246"); } + +fn double_attr_arg_helper(x: u32) -> u32 { + x * x + x +} + +#[derive(askama::Template)] +#[template( + source = "{{ self::double_attr_arg_helper(self.x.0 + 2) }}", + ext = "txt" +)] +struct DoubleAttrArg { + x: (u32,), +} + +#[test] +fn test_double_attr_arg() { + let t = DoubleAttrArg { x: (10,) }; + assert_eq!(t.render().unwrap(), "156"); +} |