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

@@ -10,17 +10,24 @@ fn source_file(path: &str, source: &str) -> SourceFile {
} }
#[test] #[test]
fn future_sight_reports_empty_inherit_findings() { fn future_sight_reports_clean_sources_as_clean() {
let report = xatu::future_sight(vec![ let report = xatu::future_sight(vec![source_file(
source_file("clean.nix", include_str!("testdata/clean.nix")), "clean.nix",
source_file( include_str!("testdata/clean.nix"),
"empty_inherit.nix", )])
include_str!("testdata/empty_inherit.nix"), .expect("source should parse");
),
]) assert!(report.is_clean());
.expect("sources should parse"); }
#[test]
fn future_sight_reports_empty_inherit_findings() {
let report = xatu::future_sight(vec![source_file(
"empty_inherit.nix",
include_str!("testdata/empty_inherit.nix"),
)])
.expect("source 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];