feat(nix/readTree): add tests of the traversal logic in README
This should closely match the documented behaviour. It might still be missing some edge cases of course. Change-Id: I5c75fa045d5f3be8cf5eab787a02644500c14522 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2466 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
This commit is contained in:
parent
768f5ec301
commit
5da7ee9e8a
15 changed files with 95 additions and 1 deletions
|
|
@ -0,0 +1,7 @@
|
|||
{ ... }:
|
||||
derivation {
|
||||
name = "im-a-drv";
|
||||
system = builtins.currentSystem;
|
||||
builder = "/bin/sh";
|
||||
args = [ "-c" ''echo "" > $out'' ];
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{ ... }:
|
||||
|
||||
"Picked up through the drv"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
no = "siblings should be read";
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{ ... }:
|
||||
|
||||
"I’m not merged with any children"
|
||||
|
|
@ -0,0 +1 @@
|
|||
"not accessible since parent default.nix is not an attrset"
|
||||
|
|
@ -0,0 +1 @@
|
|||
"I’m left alone"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{ ... }:
|
||||
|
||||
"but I’m picked up"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{ ... }:
|
||||
|
||||
"am I subtree yet?"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{ ... }:
|
||||
|
||||
"cool"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
but = "the default.nix is still read";
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
this file makes subdirs be skipped, I hope
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{ ... }:
|
||||
|
||||
"am I subtree yet?"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{ ... }:
|
||||
|
||||
"cool"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
but = "the default.nix is still read";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue