test(xatu): order assertions by actual value
This commit is contained in:
@@ -34,7 +34,7 @@ fn future_sight_rejects_parse_errors() {
|
|||||||
let error = xatu::future_sight(vec![source_file("testdata/invalid.nix")])
|
let error = xatu::future_sight(vec![source_file("testdata/invalid.nix")])
|
||||||
.expect_err("fixture should fail to parse");
|
.expect_err("fixture should fail to parse");
|
||||||
|
|
||||||
assert_eq!(Code::FailedPrecondition, error.code());
|
assert_eq!(error.code(), Code::FailedPrecondition);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -42,12 +42,12 @@ fn future_sight_reports_empty_inherit_findings() {
|
|||||||
let report = xatu::future_sight(vec![source_file("testdata/empty_inherit.nix")])
|
let report = xatu::future_sight(vec![source_file("testdata/empty_inherit.nix")])
|
||||||
.expect("fixture should parse");
|
.expect("fixture should parse");
|
||||||
|
|
||||||
assert_eq!(1, report.diagnostics.len());
|
assert_eq!(report.diagnostics.len(), 1);
|
||||||
|
|
||||||
let diagnostic = &report.diagnostics[0];
|
let diagnostic = &report.diagnostics[0];
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
PathBuf::from("testdata/empty_inherit.nix"),
|
|
||||||
report.files.get(diagnostic.file_id).path,
|
report.files.get(diagnostic.file_id).path,
|
||||||
|
PathBuf::from("testdata/empty_inherit.nix"),
|
||||||
);
|
);
|
||||||
assert_eq!("empty_inherit", diagnostic.finding.rule_id);
|
assert_eq!(diagnostic.finding.rule_id, "empty_inherit");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user