fix(natu): preserve NixOS cfg bindings

This commit was merged in pull request #104.
This commit is contained in:
2026-09-26 23:24:54 -04:00
parent 5e5c3e2534
commit ac5cc8d659
4 changed files with 49 additions and 25 deletions

View File

@@ -65,6 +65,18 @@ fn natu_reports_out_of_order_let_bindings() -> googletest::Result<()> {
Ok(())
}
#[gtest]
fn natu_preserves_nixos_cfg_bindings() -> googletest::Result<()> {
let report = natu::future_sight(vec![SourceFile {
path: PathBuf::from("configs/nixos/test.nix"),
source: "{ config, ... }: let\n cfg = config.example;\n value = cfg;\nin value\n".into(),
}])
.or_fail()?;
expect_that!(report.is_clean(), is_true());
Ok(())
}
#[gtest]
fn natu_reports_unquoted_uri() -> googletest::Result<()> {
let report = natu::future_sight(vec![fixture_source("testdata/lint_findings.nix")?]).or_fail()?;