summaryrefslogtreecommitdiffstats
path: root/tests/common/amin.sh
blob: c4d53fb10213e80f169688b59ecf4a0eb9e5be00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cd "$TEST"

now=$(epoch_time)

"$XTOUCH" -at "@$((now - 60 * 60))" one_hour_ago
"$XTOUCH" -at "@$((now - 121))" two_minutes_ago
"$XTOUCH" -at "@$((now - 61))" one_minute_ago
"$XTOUCH" -at "@$((now - 30))" thirty_seconds_ago
"$XTOUCH" -at "@$((now + 60))" in_one_minute
"$XTOUCH" -at "@$((now + 60 * 60))" in_one_hour

bfs_diff -mindepth 1 \
    \( -amin -1 -exec printf -- '-amin -1: %s\n' {} \; -o -true \) \
    \( -amin  1 -exec printf -- '-amin  1: %s\n' {} \; -o -true \) \
    \( -amin +1 -exec printf -- '-amin +1: %s\n' {} \; -o -true \)