test(xatu): split future sight cases
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user