2024-05-28 19:43:04 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-03-15 13:55:32 +02:00
|
|
|
source common.sh
|
|
|
|
|
2024-06-04 23:32:57 +03:00
|
|
|
touch "$TEST_ROOT/foo" -t 202211111111
|
2022-03-16 09:56:01 +02:00
|
|
|
# We only check whether 2022-11-1* **:**:** is the last modified date since
|
2022-03-15 13:55:32 +02:00
|
|
|
# `lastModified` is transformed into UTC in `builtins.fetchTarball`.
|
2022-03-30 12:42:47 +03:00
|
|
|
[[ "$(nix eval --impure --raw --expr "(builtins.fetchTree \"path://$TEST_ROOT/foo\").lastModifiedDate")" =~ 2022111.* ]]
|
2024-10-16 18:18:07 +03: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 ]]
|