2024-05-28 16:43:04 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-03-15 11:55:32 +00:00
|
|
|
source common.sh
|
|
|
|
|
2024-06-04 20:32:57 +00:00
|
|
|
touch "$TEST_ROOT/foo" -t 202211111111
|
2022-03-16 07:56:01 +00:00
|
|
|
# We only check whether 2022-11-1* **:**:** is the last modified date since
|
2022-03-15 11:55:32 +00:00
|
|
|
# `lastModified` is transformed into UTC in `builtins.fetchTarball`.
|
2022-03-30 09:42:47 +00:00
|
|
|
[[ "$(nix eval --impure --raw --expr "(builtins.fetchTree \"path://$TEST_ROOT/foo\").lastModifiedDate")" =~ 2022111.* ]]
|
2024-10-16 15:18:07 +00:00
|
|
|
|
|
|
|
# Check that we can override lastModified for "path:" inputs.
|
|
|
|
[[ "$(nix eval --impure --expr "(builtins.fetchTree { type = \"path\"; path = \"$TEST_ROOT/foo\"; lastModified = 123; }).lastModified")" = 123 ]]
|