[PATCH 3/4] test: extract and flag second rounding tests as broken

Jani Nikula jani at nikula.org
Mon Mar 2 09:47:03 PST 2015


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 ca3ecb4036ed..9247bdf89543 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 <<EOF > 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.1.4



More information about the notmuch mailing list