test(xatu): split future sight cases

This commit is contained in:
2026-09-18 23:14:44 -04:00
parent a2ae2e1500
commit 6beb4db1e5

View File

@@ -9,18 +9,25 @@ fn source_file(path: &str, source: &str) -> SourceFile {
} }
} }
#[test]
fn future_sight_reports_clean_sources_as_clean() {
let report = xatu::future_sight(vec![source_file(
"clean.nix",
include_str!("testdata/clean.nix"),
)])
.expect("source should parse");
assert!(report.is_clean());
}
#[test] #[test]
fn future_sight_reports_empty_inherit_findings() { fn future_sight_reports_empty_inherit_findings() {
let report = xatu::future_sight(vec![ let report = xatu::future_sight(vec![source_file(
source_file("clean.nix", include_str!("testdata/clean.nix")),
source_file(
"empty_inherit.nix", "empty_inherit.nix",
include_str!("testdata/empty_inherit.nix"), include_str!("testdata/empty_inherit.nix"),
), )])
]) .expect("source should parse");
.expect("sources should parse");
assert!(!report.is_clean());
assert_eq!(1, report.diagnostics.len()); assert_eq!(1, report.diagnostics.len());
let diagnostic = &report.diagnostics[0]; let diagnostic = &report.diagnostics[0];