From c350bf8b5e73480bb37d3b0742c0971fe2b15243 Mon Sep 17 00:00:00 2001 From: piegames Date: Sun, 5 Oct 2025 21:31:42 +0200 Subject: [PATCH] tests/functional2/lang: Migrate builtins.readFileType Change-Id: I7f6c4cddb8d969cb45652e1f72c0001a0ebd2d38 --- .../lang/builtins.readFileType/__init__.py | 0 .../builtins.readFileType/eval-okay.out.exp} | 0 .../lang/builtins.readFileType/in.nix} | 0 .../test_read_file_type.py | 29 +++++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 tests/functional2/lang/builtins.readFileType/__init__.py rename tests/{functional/lang/eval-okay-readFileType.exp => functional2/lang/builtins.readFileType/eval-okay.out.exp} (100%) rename tests/{functional/lang/eval-okay-readFileType.nix => functional2/lang/builtins.readFileType/in.nix} (100%) create mode 100644 tests/functional2/lang/builtins.readFileType/test_read_file_type.py diff --git a/tests/functional2/lang/builtins.readFileType/__init__.py b/tests/functional2/lang/builtins.readFileType/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/functional/lang/eval-okay-readFileType.exp b/tests/functional2/lang/builtins.readFileType/eval-okay.out.exp similarity index 100% rename from tests/functional/lang/eval-okay-readFileType.exp rename to tests/functional2/lang/builtins.readFileType/eval-okay.out.exp diff --git a/tests/functional/lang/eval-okay-readFileType.nix b/tests/functional2/lang/builtins.readFileType/in.nix similarity index 100% rename from tests/functional/lang/eval-okay-readFileType.nix rename to tests/functional2/lang/builtins.readFileType/in.nix diff --git a/tests/functional2/lang/builtins.readFileType/test_read_file_type.py b/tests/functional2/lang/builtins.readFileType/test_read_file_type.py new file mode 100644 index 000000000..b784125a4 --- /dev/null +++ b/tests/functional2/lang/builtins.readFileType/test_read_file_type.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_file_type(files: Path, nix: Nix, snapshot: Callable[[str], Snapshot]): + nix_eval(files, nix, [], snapshot)