## Copyright (C) 1996-2026 The Squid Software Foundation and contributors
##
## Squid software is distributed under GPLv2+ license and includes
## contributions from numerous individuals and organizations.
## Please see the COPYING and CONTRIBUTORS files for details.

#
# Tests for directives with time units
#

# a millisecond-precision parameter (time-units)

# minimum checks
dns_timeout 1 millisecond
dns_timeout 0.001 second

# check support for the maximum value (expressed in each supported time unit)
dns_timeout 9223372036854 milliseconds
dns_timeout 9223372036 seconds
dns_timeout 153722867 minutes
dns_timeout 2562047 hours
dns_timeout 106751 days
dns_timeout 15250 weeks
dns_timeout 7625 fortnights
dns_timeout 3558 months
dns_timeout 292.27 years
dns_timeout 29.227 decades


# a second-precision parameter (time-units)

# minimum checks
max_stale 1 second
max_stale 0.0167 minute

# check support for the maximum value (expressed in each supported time unit)
# XXX: Use a 32-bit maximum to avoid breaking tests on 32-bit platforms.
# TODO: Generate these test lines based on the target build platform.
max_stale 2147483647 seconds # 2^31-1
max_stale 35791394 minutes # floor(max_stale seconds/60)
max_stale 596523 hours # floor(max_stale minutes/60)
max_stale 24855 days # floor(max_stale hours/24)
max_stale 3550 weeks # floor(max_stale days/7)
max_stale 1775 fortnights # floor(max_stale weeks/2)
max_stale 828.5 months # max_stale days/30
max_stale 68.04 years # approx(max_stale days/365.2522)
max_stale 6.804 decades # max_stale years/10

# a multiple-options parameter

url_rewrite_timeout 1 second on_timeout=bypass
url_rewrite_timeout 0.001 year on_timeout=bypass
url_rewrite_timeout 292 year on_timeout=bypass

# should be a WARNING (-k parse)
url_rewrite_timeout 1 on_timeout=bypass

# TODO: a nanosecond-precison parameter (time-units-small)

