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]
fn future_sight_reports_empty_inherit_findings() {
let report = xatu::future_sight(vec![
source_file("clean.nix", include_str!("testdata/clean.nix")),
source_file(
"empty_inherit.nix",
include_str!("testdata/empty_inherit.nix"),
),
])
.expect("sources should parse");
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]
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());
let diagnostic = &report.diagnostics[0];