compare exp out || fail=1
compare exp code || fail=1
-# The error message must begin with "standard output:"
-# (but don't hard-code the strerror text)
grep '^seq: write error: ' err \
|| { warn_ "seq emitted incorrect error on EPIPE"; \
cat err;\
sort: using simple byte comparison
17
sort: using simple byte comparison
-18
-sort: failed to set locale
-sort: using simple byte comparison
EOF
echo 1 >> out
sort -rM --debug /dev/null 2>>out #no warning
echo 17 >> out
sort -rM -k1,1 --debug /dev/null 2>>out #no warning
-echo 18 >> out
-LC_ALL=missing sort --debug /dev/null 2>>out.t
-# musl libc accepts "missing" and implicitly uses UTF8,
-# so adjust the expected message accordingly.
-sed 's/using .*missing.* sorting rules/using simple byte comparison/' \
- out.t >>out
compare exp out || fail=1
+
+cat <<\EOF > exp
+sort: failed to set locale
+sort: using simple byte comparison
+EOF
+
+LC_ALL=missing sort --debug /dev/null 2>out
+
+# musl libc maps unknown locales to the default utf8 locale
+# with no way to determine failures. This is discussed at:
+# http://www.openwall.com/lists/musl/2016/04/02/1
+if ! grep -E 'using .*(missing|C.UTF-8).* sorting rules' out; then
+ compare exp out || fail=1
+fi
+
+
cat <<\EOF > exp
sort: using simple byte comparison
sort: key 1 is numeric and spans multiple fields
2'
touch "$nlname" || framework_failure_
printf '%s\0' "$nlname" | wc --files0-from=- > out || fail=1
-printf '%s\n' "0 0 0 '1'$'\\n''2'" > exp || framework_failure_
+printf '%s\n' "0 0 0 '1'\$'\\n''2'" > exp || framework_failure_
compare exp out || fail=1
# Ensure correct byte counts, which fails between v8.24 and v8.26 inclusive