test(xatu): add let ordering fixture

This commit is contained in:
2026-09-26 19:49:25 -04:00
parent b43f6f294d
commit 7cec935561
3 changed files with 9 additions and 6 deletions

View File

@@ -34,6 +34,7 @@ rust_test(
data = [
"testdata/clean.nix",
"testdata/invalid.nix",
"testdata/let_order.nix",
"testdata/lint_findings.nix",
],
deps = [

7
src/xatu/testdata/let_order.nix vendored Normal file
View File

@@ -0,0 +1,7 @@
let
second = 2;
first = 1;
in {
firstField = first;
secondField = second;
}

View File

@@ -43,12 +43,7 @@ fn xatu_rejects_invalid_source() -> googletest::Result<()> {
#[gtest]
fn xatu_reports_out_of_order_let_binding() -> googletest::Result<()> {
let report = xatu::future_sight(vec![SourceFile {
path: PathBuf::from("test.nix"),
source: "let\n second = 2;\n first = 1;\nin {\n firstField = first;\n secondField = second;\n}\n"
.to_owned(),
}])
.or_fail()?;
let report = xatu::future_sight(vec![fixture_source("testdata/let_order.nix")?]).or_fail()?;
expect_that!(
report