added cargo-tarpaulin to flake, added some tests to cracked_md
All checks were successful
Test the running changes / Test (push) Successful in 40s

This commit is contained in:
2025-11-23 20:52:05 +02:00
parent 1aa6af3b1a
commit 7d602fffba
4 changed files with 46 additions and 1 deletions

View File

@@ -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());
}
}