From d6c2c94896c4e9f49e187f6c7b0f0d376a2d02ac Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 4 Jun 2024 13:54:16 -0400 Subject: tests/common: Add tests for -[am]{min,time} --- tests/common/mmin.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/common/mmin.sh (limited to 'tests/common/mmin.sh') diff --git a/tests/common/mmin.sh b/tests/common/mmin.sh new file mode 100644 index 0000000..38e3337 --- /dev/null +++ b/tests/common/mmin.sh @@ -0,0 +1,15 @@ +cd "$TEST" + +now=$(epoch_time) + +"$XTOUCH" -mt "@$((now - 60 * 60))" one_hour_ago +"$XTOUCH" -mt "@$((now - 121))" two_minutes_ago +"$XTOUCH" -mt "@$((now - 61))" one_minute_ago +"$XTOUCH" -mt "@$((now - 30))" thirty_seconds_ago +"$XTOUCH" -mt "@$((now + 60))" in_one_minute +"$XTOUCH" -mt "@$((now + 60 * 60))" in_one_hour + +bfs_diff -mindepth 1 \ + \( -mmin -1 -exec printf -- '-mmin -1: %s\n' {} \; -o -true \) \ + \( -mmin 1 -exec printf -- '-mmin 1: %s\n' {} \; -o -true \) \ + \( -mmin +1 -exec printf -- '-mmin +1: %s\n' {} \; -o -true \) -- cgit v1.2.3