mirror of
https://github.com/sharkdp/bat.git
synced 2025-08-18 20:10:13 +02:00
Merge branch 'master' into fix/2731_plain_override
This commit is contained in:
@@ -9,7 +9,6 @@ use tempfile::tempdir;
|
||||
mod unix {
|
||||
pub use std::fs::File;
|
||||
pub use std::io::{self, Write};
|
||||
pub use std::os::unix::io::FromRawFd;
|
||||
pub use std::path::PathBuf;
|
||||
pub use std::process::Stdio;
|
||||
pub use std::thread;
|
||||
@@ -416,8 +415,8 @@ fn no_args_doesnt_break() {
|
||||
// not exit, because in this case it is safe to read and write to the same fd, which is why
|
||||
// this test exists.
|
||||
let OpenptyResult { master, slave } = openpty(None, None).expect("Couldn't open pty.");
|
||||
let mut master = unsafe { File::from_raw_fd(master) };
|
||||
let stdin_file = unsafe { File::from_raw_fd(slave) };
|
||||
let mut master = File::from(master);
|
||||
let stdin_file = File::from(slave);
|
||||
let stdout_file = stdin_file.try_clone().unwrap();
|
||||
let stdin = Stdio::from(stdin_file);
|
||||
let stdout = Stdio::from(stdout_file);
|
||||
@@ -1964,6 +1963,16 @@ fn show_all_with_unicode() {
|
||||
.stderr("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn binary_as_text() {
|
||||
bat()
|
||||
.arg("--binary=as-text")
|
||||
.arg("control_characters.txt")
|
||||
.assert()
|
||||
.stdout("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F")
|
||||
.stderr("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_paging_arg() {
|
||||
bat()
|
||||
|
Reference in New Issue
Block a user