about summary refs log tree commit diff
path: root/tvix/eval/src/tests
diff options
context:
space:
mode:
authorIlan Joselevich <personal@ilanjoselevich.com>2024-08-03T22·00+0300
committerIlan Joselevich <personal@ilanjoselevich.com>2024-08-09T14·35+0000
commit3511e328ec67c0481c1412675c1b47025486d453 (patch)
tree675dfce09263441e6cf2e673067ca0792fc3016a /tvix/eval/src/tests
parent9c4b57ac6330da5c6aa795778dd7e0e6c0721d67 (diff)
feat(tvix/eval): Implement builtins.readFileType r/8466
builtins.readFileType was added to Nix back in version 2.14.

The tests were also moved out of notyetpassing in addition to the
readDir fixtures they depend on.

I caught a bug where we previously used std::fs::metadata (via the
.metadata() method on File) which follows symlinks so it would always
return false for is_symlink(). Instead we now use
std::fs::symlink_metadata directly which does not follow symlinks, so
tests now pass. This wasn't an issue for builtins.readDir as it uses
walkdir and walkdir doesn't follow symlinks either.

Change-Id: I58eb97bdb5ec95df4f6882f495f8c572fe7c6793
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12130
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/tests')
-rw-r--r--tvix/eval/src/tests/nix_tests/eval-okay-readFileType.exp (renamed from tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.exp)0
-rw-r--r--tvix/eval/src/tests/nix_tests/eval-okay-readFileType.nix (renamed from tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.nix)0
-rw-r--r--tvix/eval/src/tests/nix_tests/readDir/bar (renamed from tvix/eval/src/tests/nix_tests/notyetpassing/readDir/bar)0
-rw-r--r--tvix/eval/src/tests/nix_tests/readDir/foo/git-hates-directories (renamed from tvix/eval/src/tests/nix_tests/notyetpassing/readDir/foo/git-hates-directories)0
l---------tvix/eval/src/tests/nix_tests/readDir/ldir (renamed from tvix/eval/src/tests/nix_tests/notyetpassing/readDir/ldir)0
l---------tvix/eval/src/tests/nix_tests/readDir/linked (renamed from tvix/eval/src/tests/nix_tests/notyetpassing/readDir/linked)0
6 files changed, 0 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.exp b/tvix/eval/src/tests/nix_tests/eval-okay-readFileType.exp
index 6413f6d4f9ec..6413f6d4f9ec 100644
--- a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.exp
+++ b/tvix/eval/src/tests/nix_tests/eval-okay-readFileType.exp
diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.nix b/tvix/eval/src/tests/nix_tests/eval-okay-readFileType.nix
index 174fb6c3a028..174fb6c3a028 100644
--- a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-readFileType.nix
+++ b/tvix/eval/src/tests/nix_tests/eval-okay-readFileType.nix
diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/bar b/tvix/eval/src/tests/nix_tests/readDir/bar
index e69de29bb2d1..e69de29bb2d1 100644
--- a/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/bar
+++ b/tvix/eval/src/tests/nix_tests/readDir/bar
diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/foo/git-hates-directories b/tvix/eval/src/tests/nix_tests/readDir/foo/git-hates-directories
index e69de29bb2d1..e69de29bb2d1 100644
--- a/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/foo/git-hates-directories
+++ b/tvix/eval/src/tests/nix_tests/readDir/foo/git-hates-directories
diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/ldir b/tvix/eval/src/tests/nix_tests/readDir/ldir
index 19102815663d..19102815663d 120000
--- a/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/ldir
+++ b/tvix/eval/src/tests/nix_tests/readDir/ldir
diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/linked b/tvix/eval/src/tests/nix_tests/readDir/linked
index c503f86a0cf7..c503f86a0cf7 120000
--- a/tvix/eval/src/tests/nix_tests/notyetpassing/readDir/linked
+++ b/tvix/eval/src/tests/nix_tests/readDir/linked