diff --git a/tests/functional/flakes/inputs.sh b/tests/functional/flakes/inputs.sh deleted file mode 100644 index 80620488a..000000000 --- a/tests/functional/flakes/inputs.sh +++ /dev/null @@ -1,80 +0,0 @@ -source ./common.sh - -requireGit - - -test_subdir_self_path() { - baseDir=$TEST_ROOT/$RANDOM - flakeDir=$baseDir/b-low - mkdir -p $flakeDir - writeSimpleFlake $baseDir - writeSimpleFlake $flakeDir - - echo all good > $flakeDir/message - cat > $flakeDir/flake.nix < $flakeDir/message - cat > $flakeDir/flake.nix < $clientDir/flake.nix < PATH=" in nix.nix(["build", f"{files}/b-low", "--no-link"]).run().ok().stderr_s + + +@with_files({"repo": files | get_global_asset_pack(".git"), "client": {}}) +def test_git_subdir_self_path(nix: Nix, files: Path, git: Git): + repo_dir = files / "repo" + git(repo_dir, "add", ".") + git(repo_dir, "commit", "-m", "init") + + client_dir = files / "client" + (client_dir / "flake.nix").write_text(f"""{{ + inputs.inp = {{ + type = "git"; + url = "file://{repo_dir}"; + dir = "b-low"; + }}; + + outputs = inputs: rec {{ + packages = inputs.inp.packages; + }}; + }}""") + + assert "simple> PATH=" in nix.nix(["build", client_dir, "--no-link"]).run().ok().stderr_s