]> git.ipfire.org Git - thirdparty/util-linux.git/commit
tests: (column) use actually invalid multibytes to test encoding
authorPatrick Steinhardt <ps@pks.im>
Fri, 23 Aug 2019 13:32:56 +0000 (15:32 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 27 Aug 2019 07:36:50 +0000 (09:36 +0200)
commit6ef9a9e18471b9a57d2b28fd76b4b8e3840d3ffa
tree0e0e2426e90ac4c0aa1e70a6ffb8556b5d4347fa
parent5718f8d96b90871dc4ff759be4164f6daf4f6161
tests: (column) use actually invalid multibytes to test encoding

If reading an invalid multibyte sequence, column(1) will encode the byte
as "\x<hex>" 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 <ps@pks.im>
tests/expected/column/invalid-multibyte
tests/ts/column/invalid-multibyte