Module Name: src
Committed By: gutteridge
Date: Sat Feb 22 23:38:09 UTC 2025
Modified Files:
src/tests/usr.bin/cut: t_cut.sh
Log Message:
t_cut.sh: correct a test case for -n (PR bin/59029)
The test case added before was based on how a version of GNU coreutils
cut(1) -- as patched by Red Hat to accept this flag -- behaved, but in
fact it, and OpenBSD's implementation, too, doesn't distinguish between
-c and -b -n, which doesn't align with the meaning/implementation used
in commercial Unix variants that originally offered -n (e.g., Solaris
and Tru64).
The new version of the test case clearly illustrates the differences
between interpretations of this flag (Solaris, FreeBSD, RHEL/Fedora,
OpenBSD).
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/cut/t_cut.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/cut/t_cut.sh
diff -u src/tests/usr.bin/cut/t_cut.sh:1.4 src/tests/usr.bin/cut/t_cut.sh:1.5
--- src/tests/usr.bin/cut/t_cut.sh:1.4 Fri Jan 24 22:26:41 2025
+++ src/tests/usr.bin/cut/t_cut.sh Sat Feb 22 23:38:09 2025
@@ -1,4 +1,4 @@
-# $NetBSD: t_cut.sh,v 1.4 2025/01/24 22:26:41 gutteridge Exp $
+# $NetBSD: t_cut.sh,v 1.5 2025/02/22 23:38:09 gutteridge Exp $
#
# Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -130,8 +130,8 @@ nflag_body()
export LC_ALL=en_US.UTF-8
atf_expect_fail "PR bin/59029"
- atf_check -o inline:"bar\nBar\nBAr\nBAR\n" \
- cut -b 6,7,8 -n "$(atf_get_srcdir)/d_utf8.in"
+ atf_check -o inline:$'\xC3\x84:b\n\xC3\x84:B\n\xC3\x84:B\n\xC3\x84:B\n' \
+ cut -b 5,6,7 -n "$(atf_get_srcdir)/d_utf8.in"
}
atf_init_test_cases()