aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2015-03-02 19:47:03 +0200
committerDavid Bremner <david@tethera.net>2015-03-06 21:36:20 +0100
commit952f46fedc0d385650e00ad739814a0127e13fa1 (patch)
treeb321f8f6ca982f31334417dd974f989f2de77901
parent65dee41fb64a3831639e6de7ff7a8dd4e8dbc9f9 (diff)
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.
-rwxr-xr-xtest/T490-parse-time-string.sh16
1 files 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 <<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