From 952f46fedc0d385650e00ad739814a0127e13fa1 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Mon, 2 Mar 2015 19:47:03 +0200 Subject: [PATCH] test: extract and flag second rounding tests as broken Extract and add some more tests relating to rounding seconds into a separate subtest, and flag it as broken. If seconds are not specified, the time is not set or rounded according to the interface defined in parse-time-string/parse-time-string.h. Instead, seconds are always set to 00 in reality, which is broken. --- test/T490-parse-time-string.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/T490-parse-time-string.sh b/test/T490-parse-time-string.sh index ca3ecb40..9247bdf8 100755 --- a/test/T490-parse-time-string.sh +++ b/test/T490-parse-time-string.sh @@ -40,8 +40,6 @@ two mo ==> Thu Nov 11 12:13:14 +0000 2010 5m ==> Tue Jan 11 12:08:14 +0000 2011 dozen mi ==> Tue Jan 11 12:01:14 +0000 2011 8am ==> Tue Jan 11 08:00:00 +0000 2011 -9:15 ==> Tue Jan 11 09:15:00 +0000 2011 -12:34 ==> Tue Jan 11 12:34:00 +0000 2011 monday ==> Mon Jan 10 12:13:14 +0000 2011 yesterday ==> Mon Jan 10 12:13:14 +0000 2011 tomorrow ==> ERROR: KEYWORD @@ -80,4 +78,18 @@ EOF ${TEST_DIRECTORY}/parse-time --ref=${REFERENCE} < INPUT > OUTPUT test_expect_equal_file INPUT OUTPUT +test_begin_subtest "Second rounding tests" +test_subtest_known_broken +REFERENCE=$(_date Tue Jan 11 12:13:14 +0000 2011) +cat < INPUT +9:15 ==> Tue Jan 11 09:15:14 +0000 2011 +12:34 ==> Tue Jan 11 12:34:14 +0000 2011 +10:30 ==> Tue Jan 11 10:30:14 +0000 2011 +10:30 ==^> Tue Jan 11 10:30:59 +0000 2011 +10:30 ==^^> Tue Jan 11 10:31:00 +0000 2011 +10:30 ==_> Tue Jan 11 10:30:00 +0000 2011 +EOF +${TEST_DIRECTORY}/parse-time --ref=${REFERENCE} < INPUT > OUTPUT +test_expect_equal_file INPUT OUTPUT + test_done -- 2.43.0