]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: env: ensure non-utf8 name or value is supported
authorPádraig Brady <P@draigBrady.com>
Thu, 11 Dec 2025 21:19:19 +0000 (21:19 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 11 Dec 2025 21:27:44 +0000 (21:27 +0000)
* tests/env/env.sh: Add a test case ensuring non-utf8 characters
in the name or value are supported.

tests/env/env.sh

index a76b4013283588dc1bb4c4caea7e7ac517065ed4..1ee3bc930fdd1ed9b5ee9f86d0833b2da9fdb081 100755 (executable)
@@ -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 <<EOF > unlikely_name/also_unlikely || framework_failure_