diff options
author | sharkdp <davidpeter@web.de> | 2019-02-10 09:19:38 +0100 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2019-02-10 10:18:07 +0100 |
commit | fa3244f7c19431a386d8da02437e48cdb3b2f196 (patch) | |
tree | 7cb0a20870653b533570360afd6c294b27a91dc7 /tests | |
parent | 906774e6d3e55831a29f611757f609fba0717628 (diff) |
Add test for UTF-16LE encoding
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examples/test_UTF-16LE.txt | bin | 0 -> 26 bytes | |||
-rw-r--r-- | tests/integration_tests.rs | 12 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/examples/test_UTF-16LE.txt b/tests/examples/test_UTF-16LE.txt Binary files differnew file mode 100644 index 00000000..d43fec4c --- /dev/null +++ b/tests/examples/test_UTF-16LE.txt diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index c0c282e3..7d9856ac 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -436,3 +436,15 @@ fn config_read_arguments_from_file() { .success() .stdout("dummy-pager-from-config\n"); } + +#[test] +fn utf16() { + // The output will be converted to UTF-8 with a leading UTF-8 BOM + bat() + .arg("--plain") + .arg("--decorations=always") + .arg("test_UTF-16LE.txt") + .assert() + .success() + .stdout(std::str::from_utf8(b"\xEF\xBB\xBFhello world\n").unwrap()); +} |