feat(xatu): report deprecated toPath calls
This commit is contained in:
@@ -37,10 +37,40 @@ fn future_sight_rejects_parse_errors() {
|
||||
assert_eq!(error.code(), Code::FailedPrecondition);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn future_sight_reports_deprecated_to_path_ident_findings() {
|
||||
let report = xatu::future_sight(vec![source_file("testdata/deprecated_to_path_ident.nix")])
|
||||
.expect("fixture should parse");
|
||||
|
||||
assert_eq!(report.diagnostics.len(), 1);
|
||||
|
||||
let diagnostic = &report.diagnostics[0];
|
||||
assert_eq!(
|
||||
report.files.get(diagnostic.file_id).path,
|
||||
PathBuf::from("testdata/deprecated_to_path_ident.nix"),
|
||||
);
|
||||
assert_eq!(diagnostic.finding.rule_id, "deprecated_to_path");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn future_sight_reports_deprecated_to_path_select_findings() {
|
||||
let report = xatu::future_sight(vec![source_file("testdata/deprecated_to_path_select.nix")])
|
||||
.expect("fixture should parse");
|
||||
|
||||
assert_eq!(report.diagnostics.len(), 1);
|
||||
|
||||
let diagnostic = &report.diagnostics[0];
|
||||
assert_eq!(
|
||||
report.files.get(diagnostic.file_id).path,
|
||||
PathBuf::from("testdata/deprecated_to_path_select.nix"),
|
||||
);
|
||||
assert_eq!(diagnostic.finding.rule_id, "deprecated_to_path");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn future_sight_reports_empty_inherit_findings() {
|
||||
let report = xatu::future_sight(vec![source_file("testdata/empty_inherit.nix")])
|
||||
.expect("fixture should parse");
|
||||
.expect("fixture should parse");
|
||||
|
||||
assert_eq!(report.diagnostics.len(), 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user