From 3ef70e4b7c46b8289528b02d4d1341bf0906d481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fr=C3=B3es=20Franco?= Date: Thu, 14 May 2026 19:34:01 +0000 Subject: [PATCH] test(lsp): update find_section_range test for any-level heading match The prior commit (e849ac9) intentionally removed the h1-only restriction from find_section_range so VimwikiGenerateTagLinks stays idempotent under non-h1 tag headings. The accompanying test still asserted the old h1-only behavior and now fails. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/nuwiki-lsp/tests/link_health.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/nuwiki-lsp/tests/link_health.rs b/crates/nuwiki-lsp/tests/link_health.rs index 0a37736..3c626af 100644 --- a/crates/nuwiki-lsp/tests/link_health.rs +++ b/crates/nuwiki-lsp/tests/link_health.rs @@ -343,11 +343,13 @@ fn find_section_range_misses_when_absent() { } #[test] -fn find_section_range_only_matches_h1() { +fn find_section_range_matches_any_heading_level() { + // Section replacement accepts any heading level so + // VimwikiGenerateTagLinks stays idempotent when tag sections live + // under non-h1 headings (e.g. `== Tag: foo ==`). let src = "== Contents ==\n- [[A]]\n"; let ast = parse(src); - // h2 — should not match. - assert!(ops::find_section_range(&ast, "Contents").is_none()); + assert!(ops::find_section_range(&ast, "Contents").is_some()); } // ===== toc_edit =====