parser/tests: allow for DST change
e.g. 21d / 2w are subject to DST; update the tolerance.
This commit is contained in:
@ -81,13 +81,13 @@ static void
|
|||||||
test_date_ymwdhMs (void)
|
test_date_ymwdhMs (void)
|
||||||
{
|
{
|
||||||
struct {
|
struct {
|
||||||
std::string expr;
|
std::string expr;
|
||||||
long diff;
|
long diff;
|
||||||
int tolerance;
|
int tolerance;
|
||||||
} tests[] = {
|
} tests[] = {
|
||||||
{ "3h", 3 * 60 * 60, 1 },
|
{ "3h", 3 * 60 * 60, 1 },
|
||||||
{ "21d", 21 * 24 * 60 * 60, 1 },
|
{ "21d", 21 * 24 * 60 * 60, 3600 + 1 },
|
||||||
{ "2w", 2 * 7 * 24 * 60 * 60, 1 },
|
{ "2w", 2 * 7 * 24 * 60 * 60, 3600 + 1 },
|
||||||
|
|
||||||
{ "2y", 2 * 365 * 24 * 60 * 60, 24 * 3600 + 1 },
|
{ "2y", 2 * 365 * 24 * 60 * 60, 24 * 3600 + 1 },
|
||||||
{ "3m", 3 * 30 * 24 * 60 * 60, 3 * 24 * 3600 + 1 }
|
{ "3m", 3 * 30 * 24 * 60 * 60, 3 * 24 * 3600 + 1 }
|
||||||
@ -154,8 +154,6 @@ test_format ()
|
|||||||
"hello world, 123");
|
"hello world, 123");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user