diff options
author | max <gmx.sht@gmail.com> | 2023-10-12 14:47:49 +0300 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-10-12 13:57:48 +0200 |
commit | 5ee2dfbe6bf901c7c731e9b94ba92b82f09e9101 (patch) | |
tree | 3d2d94fb7b14f06c67f2dcb786c0d74e6846cc66 /testing/tests/macro.rs | |
parent | ac73f1d535eb3c1fa5dcfbdbd4f8f10ca6ca0139 (diff) | |
download | askama-5ee2dfbe6bf901c7c731e9b94ba92b82f09e9101.tar.gz askama-5ee2dfbe6bf901c7c731e9b94ba92b82f09e9101.tar.bz2 askama-5ee2dfbe6bf901c7c731e9b94ba92b82f09e9101.zip |
Add test for macro self argument
Signed-off-by: max <gmx.sht@gmail.com>
Diffstat (limited to 'testing/tests/macro.rs')
-rw-r--r-- | testing/tests/macro.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/tests/macro.rs b/testing/tests/macro.rs index 7e910a9..faada37 100644 --- a/testing/tests/macro.rs +++ b/testing/tests/macro.rs @@ -83,3 +83,15 @@ fn str_cmp() { let t = StrCmpTemplate; assert_eq!(t.render().unwrap(), "AfooBotherCneitherD"); } + +#[derive(Template)] +#[template(path = "macro-self-arg.html")] +struct MacroSelfArgTemplate<'a> { + s: &'a str, +} + +#[test] +fn test_macro_self_arg() { + let t = MacroSelfArgTemplate { s: "foo" }; + assert_eq!(t.render().unwrap(), "foo"); +} |