assists/inline: refactor test cases

This commit is contained in:
Léana 江 2025-08-09 09:27:36 +02:00
parent 5a5e594193
commit cf98b02fc1
No known key found for this signature in database
GPG key ID: 4E887A4CA9714ADA

View file

@ -161,36 +161,15 @@ mod tests {
#[test]
fn no_inherit() {
check_no(
r#"
{
outputs = {
self,
nixpkgs,
flake-utils,
}: {
inherit $0flake-utils;
};
}
"#,
);
check_no("let $0foo = 1; in { inherit foo; }");
check_no("{ outputs = { nixpkgs, ... }: { inherit $0nixpkgs; }; }");
check("let $0foo = 1; in { inherit foo; }", expect!["let in { foo = 1; }"]);
check_no("with lib; let inherit (lib) $0foo; in foo");
check_no("with lib; let inherit (lib) foo; in $0foo");
}
#[test]
fn no_patfield() {
check_no(
r#"
{
outputs = {
self,
nixpkgs,
$0flake-utils,
}: {
inherit flake-utils;
};
}
"#,
);
check_no("{ outputs = { $0nixpkgs, ... }: { inherit nixpkgs; }; }");
check_no("{ outputs = { $0nixpkgs, ... }: nixpkgs; }");
}
}