From: Pádraig Brady
Date: Thu, 11 Dec 2025 21:19:19 +0000 (+0000)
Subject: tests: env: ensure non-utf8 name or value is supported
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a68ffc7176405ed858b36027b03dd35e09817b37;p=thirdparty%2Fcoreutils.git
tests: env: ensure non-utf8 name or value is supported
* tests/env/env.sh: Add a test case ensuring non-utf8 characters
in the name or value are supported.
---
diff --git a/tests/env/env.sh b/tests/env/env.sh
index a76b401328..1ee3bc930f 100755
--- a/tests/env/env.sh
+++ b/tests/env/env.sh
@@ -90,6 +90,14 @@ ENV_TEST1=b
EOF
compare exp out || fail=1
+# env shouldn't care what encoding name or value is
+for nv in 'NON_UTF8_TEST=\240' 'NON_UTF8_TEST\240=1'; do
+ env $(printf "$nv") env > all || fail=1
+ grep '^NON_UTF8_TEST' all | LC_ALL=C sort > out || framework_failure_
+ printf "$nv\\n" > exp || framework_failure_
+ compare exp out || fail=1
+done
+
# PATH modifications affect exec.
mkdir unlikely_name || framework_failure_
cat <