From 730de12a630bf5e6a48200d8329943bab6ef11aa Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 31 May 2020 12:57:58 -0400 Subject: [PATCH] changelog: test parsing --- src/changelog.rs | 5 ++++- testdata/basic.md | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 testdata/basic.md diff --git a/src/changelog.rs b/src/changelog.rs index 2488d9e..9563104 100644 --- a/src/changelog.rs +++ b/src/changelog.rs @@ -78,6 +78,9 @@ where mod tests { #[test] fn read_changelog() { - assert!(super::read("CHANGELOG.md".into(), "0.1.0".into()).is_ok()); + let res = super::read("testdata/basic.md".into(), "0.1.0".into()); + assert!(res.is_ok()); + let delta = res.unwrap(); + assert_eq!(delta, "Hi there this is a test\\!\n### ADDED\n - something\n") } } diff --git a/testdata/basic.md b/testdata/basic.md new file mode 100644 index 0000000..867bf81 --- /dev/null +++ b/testdata/basic.md @@ -0,0 +1,4 @@ +## 0.1.0 +Hi there this is a test! +### ADDED +- something