added cargo-tarpaulin to flake, added some tests to cracked_md
All checks were successful
Test the running changes / Test (push) Successful in 40s
All checks were successful
Test the running changes / Test (push) Successful in 40s
This commit is contained in:
@@ -69,7 +69,14 @@ fn collect_until<I: Iterator<Item = char>>(
|
||||
mod test {
|
||||
use crate::ast::Inline;
|
||||
|
||||
use super::parse_inlines;
|
||||
use super::{collect_until, parse_inlines};
|
||||
|
||||
#[test]
|
||||
fn collect_until_without_end() {
|
||||
let mut s = "abcdef".chars().peekable();
|
||||
let res = collect_until(&mut s, '.');
|
||||
assert!(res.is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bold_text() {
|
||||
@@ -128,4 +135,26 @@ mod test {
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn single_hyperlink() {
|
||||
let md = "[my site](https://example.com)";
|
||||
let inl = parse_inlines(md).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
inl,
|
||||
vec![Inline::Link {
|
||||
text: vec![Inline::Text("my site".to_string())],
|
||||
href: "https://example.com".to_string()
|
||||
}]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hyperlink_without_link() {
|
||||
let md = "[abc]";
|
||||
let inl = parse_inlines(md);
|
||||
|
||||
assert!(inl.is_err());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user