aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-08-06 14:48:55 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-08-06 14:48:55 +0200
commit05f11a6843b482176c32d758e0c4f676d33c16be (patch)
treec7b0abb891322381eff0706aa09020fa47627c55
parent21885c06bfff5e8561dab1f2276716876b56763b (diff)
downloadaskama-05f11a6843b482176c32d758e0c4f676d33c16be.tar.gz
askama-05f11a6843b482176c32d758e0c4f676d33c16be.tar.bz2
askama-05f11a6843b482176c32d758e0c4f676d33c16be.zip
Add test for path::get_template_source()
Diffstat (limited to '')
-rw-r--r--askama_derive/src/path.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/askama_derive/src/path.rs b/askama_derive/src/path.rs
index 9431306..e48f7d7 100644
--- a/askama_derive/src/path.rs
+++ b/askama_derive/src/path.rs
@@ -51,10 +51,15 @@ pub fn get_template_source(tpl_file: &str) -> String {
#[cfg(test)]
mod tests {
- use super::find_template_from_path;
+ use super::{find_template_from_path, get_template_source};
use super::Path;
#[test]
+ fn get_source() {
+ assert_eq!(get_template_source("sub/b.html"), "bar\n");
+ }
+
+ #[test]
fn find_absolute() {
let path = find_template_from_path("sub/b.html", Some("a.html"));
assert_eq!(path, Path::new("sub/b.html"));