mirror of
https://github.com/oxalica/nil.git
synced 2025-12-23 09:19:49 +00:00
assists/inline: refactor test cases
This commit is contained in:
parent
5a5e594193
commit
cf98b02fc1
1 changed files with 6 additions and 27 deletions
|
|
@ -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; }");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue