on master help sign in
Add test for UTF-16LE encoding
commitfa3244f7c19431a386d8da02437e48cdb3b2f196 authorsharkdp <davidpeter@web.de> dateSun 10 Feb 2019, 09:19 (8 years ago) parent906774e
2 files changed+12
tests/examples/test_UTF-16LE.txt tests/integration_tests.rs+12
tests/examples/test_UTF-16LE.txtnew file

Binary file not shown.

tests/integration_tests.rs+12
@@ -436,3 +436,15 @@ fn config_read_arguments_from_file() {
436436 .success()
437437 .stdout("dummy-pager-from-config\n");
438438}
439+
440+#[test]
441+fn utf16() {
442+ // The output will be converted to UTF-8 with a leading UTF-8 BOM
443+ bat()
444+ .arg("--plain")
445+ .arg("--decorations=always")
446+ .arg("test_UTF-16LE.txt")
447+ .assert()
448+ .success()
449+ .stdout(std::str::from_utf8(b"\xEF\xBB\xBFhello world\n").unwrap());
450+}