From a68ffc7176405ed858b36027b03dd35e09817b37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Thu, 11 Dec 2025 21:19:19 +0000
Subject: [PATCH] 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.
---
tests/env/env.sh | 8 ++++++++
1 file changed, 8 insertions(+)
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 <