sync: bring Rust crates in line with nuwiki main (v0.4.2)
CI / cargo fmt --check (push) Successful in 31s
CI / cargo clippy (push) Successful in 34s
CI / cargo test (push) Successful in 49s
Release / bump + tag (push) Successful in 52s
Release / build aarch64-unknown-linux-gnu (push) Successful in 1m45s
Release / build x86_64-unknown-linux-gnu (push) Successful in 2m3s
Release / build aarch64-unknown-linux-musl (push) Successful in 2m6s
Release / build x86_64-unknown-linux-musl (push) Successful in 2m8s
Release / gitea release (push) Successful in 30s

This commit is contained in:
gffranco
2026-06-24 09:15:09 +00:00
parent d21237cfdc
commit caaafd3cf3
7 changed files with 56 additions and 10 deletions
+26
View File
@@ -85,6 +85,32 @@ fn centered_heading_is_marked_centered() {
assert!(matches!(lexed[2], HeadingClose));
}
#[test]
fn spaceless_heading_is_a_heading() {
// vimwiki accepts `==Heading==` with no spaces around the text.
let lexed = lex("==Plain==\n");
assert_eq!(
lexed,
vec![
HeadingOpen {
level: 2,
centered: false
},
text("Plain"),
HeadingClose,
Newline,
]
);
}
#[test]
fn marker_only_or_unbalanced_lines_are_not_headings() {
// No title between markers, and trailing `=` not at line end → plain text.
assert!(!matches!(lex("======\n")[0], HeadingOpen { .. }));
assert!(!matches!(lex("==> arrow\n")[0], HeadingOpen { .. }));
assert!(!matches!(lex("==a==b\n")[0], HeadingOpen { .. }));
}
#[test]
fn heading_with_inline_bold() {
let lexed = lex("== Hello *world* ==\n");