From a1974b560543788e4daed203d5ac5385d033e6bc Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 29 Oct 2026 21:30:38 +0100 Subject: [PATCH] tests: join: ensure the last of --check-order and --nocheck-order wins Reported at https://github.com/uutils/coreutils/issues/16004 * tests/join/join.pl: Add test cases. Link: https://github.com/coreutils/coreutils/pull/418 --- tests/join/join.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/join/join.pl b/tests/join/join.pl index ef6cfcbf7..ebaa3b3b3 100755 --- a/tests/join/join.pl +++ b/tests/join/join.pl @@ -264,6 +264,13 @@ my @tv = ( ['chkodr-6', '--nocheck-order', [" b 1\n a 2\n", " b Y\n c Z\n"], "b 1 Y\n", 0], +# The last of --check-order and --nocheck-order wins. +['chkodr-last-1', '--check-order --nocheck-order', + [" b 1\n a 2\n", " b Y\n a Z\n"], "b 1 Y\na 2 Z\n", 0], +['chkodr-last-2', '--nocheck-order --check-order', + [" b 1\n a 2\n", " b Y\n a Z\n"], "", 1, + "$prog: chkodr-last-2.1:2: is not sorted: a 2\n"], + # Before 6.10.143, this would mistakenly fail with the diagnostic: # join: File 1 is not in sorted order ['chkodr-7', '-12', ["2 a\n1 b\n", "2 c\n1 d"], "", 0],