Skip to content

Commit

Permalink
add more coverage to image gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
Lurk committed Apr 8, 2024
1 parent 9eba200 commit 66c8053
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/nodes/image_gallery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,22 @@ mod tests {
))
);
}

#[test]
fn default() {
assert_eq!(ImageGallery::default().to_string(), "!!!\n\n!!!");
}

#[test]
fn fail_parse() {
assert_eq!(ImageGallery::parse("not a gallery", 0, None), None);
assert_eq!(
ImageGallery::parse("!!!\n![a](u)\n![a2](u2)!!!", 0, None),
None
);
assert_eq!(
ImageGallery::parse("!!!\n![a](u)\n![a2](u2)\n", 0, None),
None
);
}
}

0 comments on commit 66c8053

Please sign in to comment.