On 24/01/2026 22:15, Collin Funk wrote:
The default Haiku install does not have a user with user ID 1 leading
to a failure with this diff:

     --- exp    2026-01-24 22:05:19.088342528 +0000
     +++ out    2026-01-24 22:05:19.072351744 +0000
     @@ -1 +1 @@
     -group of 'f' retained as
     +group of 'f' retained as 1

The actual output is correct in this case. We want to print the user
id, not leave the output empty.

-- 8< --

* tests/chgrp/from.sh: If 'id' cannot find a user name for user id 1,
expect the user id to be printed in the message of 'chgrp'.
---
  tests/chgrp/from.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/chgrp/from.sh b/tests/chgrp/from.sh
index 49ba04fa6..4d3636676 100755
--- a/tests/chgrp/from.sh
+++ b/tests/chgrp/from.sh
@@ -30,7 +30,7 @@ set _ $(ls -n f); shift; test ":$4" = ':1' || fail=1
  # Make sure the correct diagnostic is output
  # Note we output a name even though an id was specified.
  chgrp -v --from=42 43 f > out || fail=1
-printf "group of 'f' retained as $(id -nu 1)\n" > exp
+printf "group of 'f' retained as $(id -nu 1 || printf 1)\n" > exp
  compare exp out || fail=1
chgrp --from=:1 010 f || fail=1

Nice 1

Please apply

Reply via email to