Pádraig Brady <[email protected]> writes:

> On 02/08/2026 03:45, Collin Funk wrote:
>> Hey Pádraig,
>> I'm 99% sure you meant to do 'dirname' as well in your recent
>> patches.
>> But I haven't pushed this yet in case there was some reason you
>> avoided this one. It is mostly a copy of your 'basename' changes.
> Cool. dirname(1) is less likely to be used interactively,
> but it should quote for consistency.
> Can you squash the attached in to your patch
> so there is a positive test for it.

Right, thanks.

I also added some tests for -z since they seem to have been missing
with another patch.

Collin

>From 6b8c70623329f9399ec6f313a956d9d10879bf40 Mon Sep 17 00:00:00 2001
Message-ID: <6b8c70623329f9399ec6f313a956d9d10879bf40.1785697361.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Sun, 2 Aug 2026 11:24:43 -0700
Subject: [PATCH] test: dirname: add tests for -z

* tests/misc/dirname.pl (@Tests): Add a few test cases.
---
 tests/misc/dirname.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/misc/dirname.pl b/tests/misc/dirname.pl
index 0b79cdee9..0c31da666 100755
--- a/tests/misc/dirname.pl
+++ b/tests/misc/dirname.pl
@@ -59,6 +59,10 @@ my @Tests =
      ['q-invalid', q{'q name/f'}, {ENV => 'QUOTING_STYLE=invalid'},
       {OUT => 'q name'}],
 
+     # Exercise -z option.
+     ['z0', qw(-z a/b),       {OUT => "a\0"}],
+     ['z1', qw(--zero a/b),   {OUT => "a\0"}],
+     ['z2', qw(-z a/b b/a),    {OUT => "a\0b\0"}],
      ['z-quote', q{-z 'q name/f'}, {ENV => 'QUOTING_STYLE=invalid'},
       {OUT => "q name\0"}],
     );
-- 
2.55.0

Reply via email to