···6464expectSuccess "pathType $PWD/regular" '"regular"'
6565expectSuccess "pathType $PWD/symlink" '"symlink"'
6666expectSuccess "pathType $PWD/fifo" '"unknown"'
6767-# Different errors depending on whether the builtins.readFilePath primop is available or not
6868-expectFailure "pathType $PWD/non-existent" "error: (evaluation aborted with the following error message: 'lib.filesystem.pathType: Path $PWD/non-existent does not exist.'|getting status of '$PWD/non-existent': No such file or directory)"
6767+6868+# Only check error message when a Nixpkgs-specified error is thrown,
6969+# which is only the case when `readFileType` is not available
7070+# and the fallback implementation needs to be used.
7171+if [[ "$(nix-instantiate --eval --expr 'builtins ? readFileType')" == false ]]; then
7272+ expectFailure "pathType $PWD/non-existent" \
7373+ "error: evaluation aborted with the following error message: 'lib.filesystem.pathType: Path $PWD/non-existent does not exist.'"
7474+fi
69757076expectSuccess "pathIsDirectory /." "true"
7177expectSuccess "pathIsDirectory $PWD/directory" "true"