From 5ee2dfbe6bf901c7c731e9b94ba92b82f09e9101 Mon Sep 17 00:00:00 2001 From: max Date: Thu, 12 Oct 2023 14:47:49 +0300 Subject: Add test for macro self argument Signed-off-by: max --- testing/tests/macro.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'testing/tests') 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"); +} -- cgit