While looking at test result discrepancies for the join implementation from uutils' coreutils,[0] I noticed that one of the tests seems to be testing not only for the correct error message when supplied an incorrect -j field, but also that this error message has priority over the missing operands error. The latter seems like something that shouldn't be tested, so I'm submitting a (trivial) patch to narrow the scope.

 - Justin

[0] https://github.com/uutils/coreutils
From 266e6fedf27f75570232763eadba836114472e71 Mon Sep 17 00:00:00 2001
From: Justin Tracey <j2tra...@gmail.com>
Date: Fri, 3 Sep 2021 11:46:53 -0400
Subject: [PATCH] tests: narrow scope of faulty join args

* tests/misc/join.pl: Only test invalid-j with an invalid -j field,
not with missing operands as well.
---
 tests/misc/join.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/misc/join.pl b/tests/misc/join.pl
index 8d6f17079..bfd9e6f9d 100755
--- a/tests/misc/join.pl
+++ b/tests/misc/join.pl
@@ -176,7 +176,7 @@ my @tv = (
  ["a\n", "b\n"], " a b\n", 0],
 
 # FIXME: change this to ensure the diagnostic makes sense
-['invalid-j', '-j x', {}, "", 1,
+['invalid-j', '-j x', ["", ""], "", 1,
  "$prog: invalid field number: 'x'\n"],
 
 # With ordering check, inputs in order
-- 
2.30.2

Reply via email to