diff options
Diffstat (limited to 'pkgs/populate/tests')
| -rw-r--r-- | pkgs/populate/tests/builder.nix | 5 | ||||
| -rw-r--r-- | pkgs/populate/tests/scenarios.nix | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/pkgs/populate/tests/builder.nix b/pkgs/populate/tests/builder.nix index 26a360b..91609a9 100644 --- a/pkgs/populate/tests/builder.nix +++ b/pkgs/populate/tests/builder.nix @@ -143,7 +143,10 @@ let null else { populate = toString (command sources targetPath); - inherit env interrupt output unexpected; + inherit env interrupt output; + # Nix warns about not writing lock files whenever populate looks + # at a flake, which populate leaves out. + unexpected = unexpected ++ [ "not writing modified lock file" ]; expect = if expect' == "success" then null else expect'.fail; status = if expect' == "success" then null else expect'.status or null; # No phase gets around checking the canaries. diff --git a/pkgs/populate/tests/scenarios.nix b/pkgs/populate/tests/scenarios.nix index 5622782..2ab2d0e 100644 --- a/pkgs/populate/tests/scenarios.nix +++ b/pkgs/populate/tests/scenarios.nix @@ -534,9 +534,11 @@ with import ./builder.nix args; }; })) # The lock file gets rewritten or generated again when a source inputs - # get drawn from changes. - (modes "relock" ({ draw, flake, ... }: let + # get drawn from changes. What Nix prints about a generated flake's lock + # file only gets printed then. + (modes "relock" ({ draw, flake, mode, ... }: let x.file = { path = "/fixtures/filesrc"; } // draw { dep.follows = "a"; }; + generated = optional (mode == "generated"); in { phases = [ { @@ -544,8 +546,17 @@ with import ./builder.nix args; check = '' expect_eq msg "$(nix_eval_online ${flake "x"}#msg)" top:alt,sub ''; + output = generated "creating lock file"; } { + sources = { inherit x; a.file = "/fixtures/alt"; }; + check = '' + expect_eq msg "$(nix_eval_online ${flake "x"}#msg)" top:alt,sub + ''; + unexpected = generated "lock file"; + } + { + output = generated "creating lock file"; sources = { inherit x; a.file = "/fixtures/alt2"; }; check = '' expect_eq msg "$(nix_eval_online ${flake "x"}#msg)" top:alt2,sub |
