TODO(pack) write the real headline
"#; fn scan(options: &DetectHtmlOptions<'_>) -> VecTODO(pack) write the real headline"); assert_eq!(extra[0].line, 0.0); } #[test] fn text_hook_covers_html_when_no_document_hook_is_set() { impeccable_core::rule_pack::install(&PACK); let with_text_only = scan(&DetectHtmlOptions { rule_pack: Some(&PACK), ..Default::default() }); let pack_findings: Vec<&Finding> = with_text_only .iter() .filter(|f| f.antipattern.starts_with("testpack/")) .collect(); assert_eq!(pack_findings.len(), 1); // The text hook reports the source line, not the element. assert_eq!(pack_findings[0].line, 7.0); assert_eq!( pack_findings[0].snippet, "
TODO(pack) write the real headline
" ); } #[test] fn pack_findings_are_waivable_inline() { impeccable_core::rule_pack::install(&PACK); let page = PAGE.replace( "", "\n", ); let findings = detect_html_source( &page, Path::new("/app/index.html"), &DetectHtmlOptions { static_rule_pack: Some(&PACK), ..Default::default() }, ); assert!(findings .iter() .all(|f| !f.antipattern.starts_with("testpack/"))); }