Browse Source

Add regression test for lazy front-matter matching

index-subcmd
Reilly Tucker Siemens 7 years ago
parent
commit
f0dab659cc
No known key found for this signature in database GPG Key ID: 1B458E7C7CB154A9
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      tests/front_matter.rs

+ 14
- 0
tests/front_matter.rs View File

@@ -184,6 +184,20 @@ date = "2002/10/12"
assert_eq!(front_matter.title, "Title"); 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] #[test]
fn test_error_if_cannot_locate_frontmatter() { fn test_error_if_cannot_locate_frontmatter() {
let content = r#" let content = r#"


Loading…
Cancel
Save