tests: move fixtures to dedicated dir
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9d6ce6a264780f215b1b57d947b5264c6a6a6964
This commit is contained in:
parent
3347699a8c
commit
ae505188fc
75 changed files with 478 additions and 438 deletions
19
tests/fixtures/select_or_default.nix
vendored
Normal file
19
tests/fixtures/select_or_default.nix
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Test selection with 'or' default
|
||||
let
|
||||
attrs = {
|
||||
a = 1;
|
||||
b = 2;
|
||||
};
|
||||
in {
|
||||
# Attribute exists - should use value from attrs
|
||||
has_attr = attrs.a or 999;
|
||||
|
||||
# Attribute doesn't exist - should use default
|
||||
missing_attr = attrs.c or 100;
|
||||
|
||||
# Nested default expression
|
||||
nested = attrs.d or (attrs.a + attrs.b);
|
||||
|
||||
# Default with literal
|
||||
with_string = attrs.name or "default_name";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue