mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 00:02:25 +00:00
Test baseNameOf behaviour on the root of a flake
This commit is contained in:
parent
458441c637
commit
503be57bbd
@ -23,6 +23,8 @@ writeSimpleFlake() {
|
||||
legacyPackages.$system.hello = import ./simple.nix;
|
||||
|
||||
parent = builtins.dirOf ./.;
|
||||
|
||||
baseName = builtins.baseNameOf ./.;
|
||||
};
|
||||
}
|
||||
EOF
|
||||
|
@ -234,6 +234,9 @@ nix build -o "$TEST_ROOT/result" --expr "(builtins.getFlake \"git+file://$flake1
|
||||
# Regression test for dirOf on the root of the flake.
|
||||
[[ $(nix eval --json flake1#parent) = \""$NIX_STORE_DIR"\" ]]
|
||||
|
||||
# Regression test for baseNameOf on the root of the flake.
|
||||
[[ $(nix eval --raw flake1#baseName) =~ ^[a-z0-9]*-source$ ]]
|
||||
|
||||
# Building a flake with an unlocked dependency should fail in pure mode.
|
||||
(! nix build -o "$TEST_ROOT/result" flake2#bar --no-registries)
|
||||
(! nix build -o "$TEST_ROOT/result" flake2#bar --no-use-registries)
|
||||
|
Loading…
Reference in New Issue
Block a user