Implement simple test for path-fetcher setting a correct lastModifiedDate

Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
This commit is contained in:
Maximilian Bosch 2022-03-15 12:55:32 +01:00
parent 244baff2c7
commit 975bade7f0
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E
2 changed files with 7 additions and 0 deletions

6
tests/fetchPath.sh Normal file
View file

@ -0,0 +1,6 @@
source common.sh
touch foo -t 222211111111
# We only check whether 2222-11-1* **:**:** is the last modified date since
# `lastModified` is transformed into UTC in `builtins.fetchTarball`.
[[ "$(nix eval --impure --raw --expr "(builtins.fetchTree \"path://$PWD/foo\").lastModifiedDate")" =~ 2222111.* ]]

View file

@ -21,6 +21,7 @@ nix_tests = \
tarball.sh \
fetchGit.sh \
fetchurl.sh \
fetchPath.sh \
simple.sh \
referrers.sh \
optimise-store.sh \