Skip to content

Commit

Permalink
test(lib): add test for parsing FromStr implementation of DnotePageInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
deepanchal committed Jul 8, 2023
1 parent 1823c2c commit e9860c6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/dnote_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,17 @@ mod tests {
assert_eq!(page1.id, 21);
assert_eq!(page2.id, 27);
}

#[test]
fn should_parse_dnotepageinfo_from_string() {
let input1 = "# E2E\n\n- Grab a list of all data test ids on a page\n- Make sure all those data test ids exist";
let input2 = " # E2E \n\n - Grab a list of all data test ids on a page \n - Make sure all those data test ids exist ";
let input3 = "";
let page_info1: DnotePageInfo = input1.parse().unwrap();
let page_info2: DnotePageInfo = input2.parse().unwrap();
let page_info3: DnotePageInfo = input3.parse().unwrap();
assert_eq!(page_info1.content, input1);
assert_eq!(page_info2.content, input2.trim());
assert_eq!(page_info3.content, input3);
}
}

0 comments on commit e9860c6

Please sign in to comment.