Hello

Le 08/01/2026 à 05:25, Collin Funk a écrit :
Sylvestre Ledru <[email protected]> writes:

Le 05/01/2026 à 01:11, Collin Funk a écrit :
Interesting, thanks!

If this is ok,  I will add some tests, i don't think it is properly covered 
today!
Yep, I don't see it anywhere. Some tests in date.pl would be helpful,
thanks!
Attached! it should do it!
Great, thanks. I pushed it with one more test case added, just to check
that comments enclosed in parentheses in the middle of dates are
handled.

Thanks!

One more corner case :)

((foo)2026-01-05)

Cheers
S
From 0983b573adea0b0197da90b82432def7c5edcb4f Mon Sep 17 00:00:00 2001
From: Sylvestre Ledru <[email protected]>
Date: Sun, 11 Jan 2026 17:14:26 +0100
Subject: [PATCH] tests: date: add another test parenthesis comment

* tests/date/date.pl: Add the check.
---
 tests/date/date.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/date/date.pl b/tests/date/date.pl
index 0343cb913..23c23e494 100755
--- a/tests/date/date.pl
+++ b/tests/date/date.pl
@@ -334,6 +334,10 @@ my @Tests =
      # Text enclosed in parentheses is treated as a comment
      ['paren-4', "-d '2026(this is a comment)-01-05' -u +'%Y-%m-%d'",
       {OUT=>"2026-01-05"}],
+
+     # Nested/unbalanced case
+     ['paren-5', "-d '((foo)2026-01-05)' -u +'%H:%M:%S'",
+      {OUT=>"00:00:00"}],
     );
 
 # Repeat the cross-dst test, using Jan 1, 2005 and every interval from 1..364.
-- 
2.51.0

Reply via email to