]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: date: test nested parenthesis comment handling
authorPádraig Brady <P@draigBrady.com>
Sun, 11 Jan 2026 18:51:19 +0000 (18:51 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 11 Jan 2026 18:51:19 +0000 (18:51 +0000)
* tests/date/date.pl: Add test cases.
Suggested by Sylvestre Ledru.

tests/date/date.pl

index 0343cb913fd39a3371fea8660e655ade253a871a..8a5e57363faf6ddc638195ffa49d9bdb2e1ce58a 100755 (executable)
@@ -334,6 +334,11 @@ 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 comments are supported
+     ['paren-5', "-d '((nested))2026-01-05' -u +'%Y-%m-%d'",
+      {OUT=>"2026-01-05"}],
+     ['paren-6', "-d '((nested)2026-01-05)' +'%H:%M:%S'", {OUT=>"00:00:00"}],
     );
 
 # Repeat the cross-dst test, using Jan 1, 2005 and every interval from 1..364.