From 810d5ad5067085cc5e4be19903b5804b1ff13430 Mon Sep 17 00:00:00 2001 From: Christian Vallentin Date: Wed, 2 Dec 2020 20:46:29 +0100 Subject: Allow paths to start with `::` (#393) --- testing/tests/simple.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'testing/tests/simple.rs') diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index 7241005..5ef03b1 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -290,6 +290,15 @@ fn test_path_func_call() { assert_eq!(PathFunctionTemplate.render().unwrap(), "Hello, world4123!"); } +#[derive(Template)] +#[template(source = "{{ ::std::string::ToString::to_string(123) }}", ext = "txt")] +struct RootPathFunctionTemplate; + +#[test] +fn test_root_path_func_call() { + assert_eq!(RootPathFunctionTemplate.render().unwrap(), "123"); +} + #[derive(Template)] #[template(source = "Hello, {{ Self::world3(self, \"123\", 4) }}!", ext = "txt")] struct FunctionTemplate; -- cgit