From f0dab659cc2a6e6eb1704a1890c06b90a3b4b5ae Mon Sep 17 00:00:00 2001 From: Reilly Tucker Siemens Date: Sun, 26 Mar 2017 20:01:32 -0700 Subject: [PATCH] Add regression test for lazy front-matter matching --- tests/front_matter.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/front_matter.rs b/tests/front_matter.rs index 14291c6..bea21cf 100644 --- a/tests/front_matter.rs +++ b/tests/front_matter.rs @@ -184,6 +184,20 @@ date = "2002/10/12" assert_eq!(front_matter.title, "Title"); } +#[test] +fn test_can_split_content_lazily() { + let content = r#" ++++ +title = "Title" +description = "hey there" +date = "2002-10-02T15:00:00Z" ++++ ++++"#; + let (front_matter, content) = split_content(Path::new(""), content).unwrap(); + assert_eq!(content, "+++"); + assert_eq!(front_matter.title, "Title"); +} + #[test] fn test_error_if_cannot_locate_frontmatter() { let content = r#"