]> git.kaiwu.me - haproxy.git/commit
REGTESTS: converter: add a test for the date formatting converters
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Sep 2026 20:06:08 +0000 (20:06 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 14:26:01 +0000 (16:26 +0200)
commite8c755ff476d1d99f5ba80d7f4e541369dd9a026
tree95a327d7fa699705a2a6b0bbdf1896c9d7d8add6
parentf290af32f1ec15c3a79ac07ade9d2a7b85fd542f
REGTESTS: converter: add a test for the date formatting converters

utime, ltime, ms_utime, ms_ltime, us_utime, us_ltime and http_date were
not covered at all. They are checked here against fixed input dates, so
that the expected output is constant, including the offset argument, the
%N specifier with its various widths and the unit argument of http_date.

The local time variants depend on the machine's timezone, so their
output is only matched loosely, which is still enough to verify that the
date and the sub-second part are correct.

The test also verifies that accept_date() and date() remain consistent
with each other when expressed in seconds, milliseconds and
microseconds. A test also checks that the ms_*/us_* converters apply
their offset in the right unit.
reg-tests/converter/time.vtc [new file with mode: 0644]