From 972dcc2973b160cdaad2c4ce0df3616a9f234759 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 23 Jul 2024 15:19:17 -0400 Subject: tests: Make more tests POSIX-compliant --- tests/posix/mtime.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/posix/mtime.sh (limited to 'tests/posix/mtime.sh') diff --git a/tests/posix/mtime.sh b/tests/posix/mtime.sh new file mode 100644 index 0000000..8367631 --- /dev/null +++ b/tests/posix/mtime.sh @@ -0,0 +1,15 @@ +cd "$TEST" + +now=$(epoch_time) + +"$XTOUCH" -mt "@$((now - 60 * 60 * 24 * 7))" last_week +"$XTOUCH" -mt "@$((now - 60 * 60 * 49))" two_days_ago +"$XTOUCH" -mt "@$((now - 60 * 60 * 25))" yesterday +"$XTOUCH" -mt "@$((now - 60 * 60))" one_hour_ago +"$XTOUCH" -mt "@$((now))" now +"$XTOUCH" -mt "@$((now + 60 * 60 * 24))" tomorrow + +bfs_diff . \! -name . \ + \( -mtime -1 -exec printf -- '-mtime -1: %s\n' {} \; -o -prune \) \ + \( -mtime 1 -exec printf -- '-mtime 1: %s\n' {} \; -o -prune \) \ + \( -mtime +1 -exec printf -- '-mtime +1: %s\n' {} \; -o -prune \) -- cgit v1.2.3