From c288f7fafa9745f6f78eabd818fdc37af8ba2674 Mon Sep 17 00:00:00 2001 From: Kelly Thomas Kline Date: Wed, 13 Oct 2021 02:58:58 -0700 Subject: Initial test work --- testing/tests/methods.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/testing/tests/methods.rs b/testing/tests/methods.rs index d24000e..cdd0e36 100644 --- a/testing/tests/methods.rs +++ b/testing/tests/methods.rs @@ -18,6 +18,22 @@ fn test_self_method() { assert_eq!(t.render().unwrap(), "foo"); } +#[derive(Template)] +#[template(source = "{{ self.type() }}", ext = "txt")] +struct SelfRawIdentifierMethodTemplate {} + +impl SelfRawIdentifierMethodTemplate { + fn r#type(&self) -> &str { + "foo" + } +} + +#[test] +fn test_self_rawidentifiermethod() { + let t = SelfRawIdentifierMethodTemplate {}; + assert_eq!(t.render().unwrap(), "foo"); +} + #[derive(Template)] #[template(source = "{{ self.get_s() }} {{ t.get_s() }}", ext = "txt")] struct NestedSelfMethodTemplate<'a> { -- cgit