From 4aedfd346fc341854cb2024a8b732da5e0c7d519 Mon Sep 17 00:00:00 2001 From: piegames Date: Sun, 5 Oct 2025 21:43:37 +0200 Subject: [PATCH] tests/functional2/lang: Migrate builtins.readDir Change-Id: Ic70e4ef7780281f403d0421d63ecf849e083c01e --- .../lang/readDir/foo/git-hates-directories | 0 tests/functional/lang/readDir/ldir | 1 - tests/functional/lang/readDir/linked | 1 - .../lang/builtins.readDir/__init__.py} | 0 .../lang/builtins.readDir/eval-okay.out.exp} | 0 .../lang/builtins.readDir/in.nix} | 0 .../lang/builtins.readDir/test_read_dir.py | 29 +++++++++++++++++++ 7 files changed, 29 insertions(+), 2 deletions(-) delete mode 100644 tests/functional/lang/readDir/foo/git-hates-directories delete mode 120000 tests/functional/lang/readDir/ldir delete mode 120000 tests/functional/lang/readDir/linked rename tests/{functional/lang/readDir/bar => functional2/lang/builtins.readDir/__init__.py} (100%) rename tests/{functional/lang/eval-okay-readDir.exp => functional2/lang/builtins.readDir/eval-okay.out.exp} (100%) rename tests/{functional/lang/eval-okay-readDir.nix => functional2/lang/builtins.readDir/in.nix} (100%) create mode 100644 tests/functional2/lang/builtins.readDir/test_read_dir.py diff --git a/tests/functional/lang/readDir/foo/git-hates-directories b/tests/functional/lang/readDir/foo/git-hates-directories deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/functional/lang/readDir/ldir b/tests/functional/lang/readDir/ldir deleted file mode 120000 index 191028156..000000000 --- a/tests/functional/lang/readDir/ldir +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/tests/functional/lang/readDir/linked b/tests/functional/lang/readDir/linked deleted file mode 120000 index c503f86a0..000000000 --- a/tests/functional/lang/readDir/linked +++ /dev/null @@ -1 +0,0 @@ -foo/git-hates-directories \ No newline at end of file diff --git a/tests/functional/lang/readDir/bar b/tests/functional2/lang/builtins.readDir/__init__.py similarity index 100% rename from tests/functional/lang/readDir/bar rename to tests/functional2/lang/builtins.readDir/__init__.py diff --git a/tests/functional/lang/eval-okay-readDir.exp b/tests/functional2/lang/builtins.readDir/eval-okay.out.exp similarity index 100% rename from tests/functional/lang/eval-okay-readDir.exp rename to tests/functional2/lang/builtins.readDir/eval-okay.out.exp diff --git a/tests/functional/lang/eval-okay-readDir.nix b/tests/functional2/lang/builtins.readDir/in.nix similarity index 100% rename from tests/functional/lang/eval-okay-readDir.nix rename to tests/functional2/lang/builtins.readDir/in.nix diff --git a/tests/functional2/lang/builtins.readDir/test_read_dir.py b/tests/functional2/lang/builtins.readDir/test_read_dir.py new file mode 100644 index 000000000..4e0f50ee9 --- /dev/null +++ b/tests/functional2/lang/builtins.readDir/test_read_dir.py @@ -0,0 +1,29 @@ +from collections.abc import Callable +from pathlib import Path + +from functional2.lang.test_lang import test_eval as nix_eval +from functional2.testlib.fixtures.file_helper import ( + with_files, + CopyFile, + Symlink, + AssetSymlink, + File, +) +from functional2.testlib.fixtures.nix import Nix +from functional2.testlib.fixtures.snapshot import Snapshot + + +@with_files( + { + "readDir": { + "foo": {}, + "ldir": Symlink("./foo"), + "bar": File(""), + "linked": Symlink("./bar"), + }, + "in.nix": CopyFile("in.nix"), + "out.exp": AssetSymlink("eval-okay.out.exp"), + } +) +def test_read_dir(files: Path, nix: Nix, snapshot: Callable[[str], Snapshot]): + nix_eval(files, nix, [], snapshot)