From: Patrick Steinhardt Date: Fri, 23 Aug 2019 13:32:56 +0000 (+0200) Subject: tests: (column) use actually invalid multibytes to test encoding X-Git-Tag: v2.35-rc1~264 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ef9a9e18471b9a57d2b28fd76b4b8e3840d3ffa;p=thirdparty%2Futil-linux.git tests: (column) use actually invalid multibytes to test encoding If reading an invalid multibyte sequence, column(1) will encode the byte as "\x" instead. The tests try to verify that by piping "£" into column(1). As the tests run with LC_ALL=POSIX by default, though, libc implementations strictly adhering to the POSIX standard will treat all characters as valid multibyte characters. As a consequence, no EILSEQ is raised by mbtowc(3P) and the character is not encoded as hex, breaking the test. Fix this by setting LC_ALL=C.UTF-8. As "£" is a valid UTF-8 character, we also change the test to use a proper illegal multibyte sequence. Signed-off-by: Patrick Steinhardt --- diff --git a/tests/expected/column/invalid-multibyte b/tests/expected/column/invalid-multibyte index ea40a34e9f..5b0c745036 100644 --- a/tests/expected/column/invalid-multibyte +++ b/tests/expected/column/invalid-multibyte @@ -1 +1 @@ -\xa3 +\x94~ diff --git a/tests/ts/column/invalid-multibyte b/tests/ts/column/invalid-multibyte index a9e371003b..4fcf44eb31 100755 --- a/tests/ts/column/invalid-multibyte +++ b/tests/ts/column/invalid-multibyte @@ -25,6 +25,6 @@ ts_check_test_command "$TS_CMD_COLUMN" ts_cd "$TS_OUTDIR" -printf "£\n" | LC_ALL=C $TS_CMD_COLUMN >> $TS_OUTPUT 2>&1 +printf "\x94\x7e\n" | LC_ALL=C.UTF-8 $TS_CMD_COLUMN >> $TS_OUTPUT 2>&1 ts_finalize