diff --git a/src/tools/miri/tests/pass/shims/fs.rs b/src/tools/miri/tests/pass/shims/fs.rs index 1758e486ac3f..65cf6fe66ba5 100644 --- a/src/tools/miri/tests/pass/shims/fs.rs +++ b/src/tools/miri/tests/pass/shims/fs.rs @@ -3,6 +3,7 @@ #![feature(io_error_more)] #![feature(io_error_uncategorized)] +#![feature(is_terminal)] use std::collections::HashMap; use std::ffi::OsString; @@ -10,7 +11,7 @@ use std::fs::{ canonicalize, create_dir, read_dir, read_link, remove_dir, remove_dir_all, remove_file, rename, File, OpenOptions, }; -use std::io::{Error, ErrorKind, Read, Result, Seek, SeekFrom, Write}; +use std::io::{Error, ErrorKind, IsTerminal, Read, Result, Seek, SeekFrom, Write}; use std::path::{Path, PathBuf}; fn main() { @@ -91,6 +92,8 @@ fn test_file() { file.read_to_end(&mut contents).unwrap(); assert_eq!(bytes, contents.as_slice()); + assert!(!file.is_terminal()); + // Removing file should succeed. remove_file(&path).unwrap(); } diff --git a/src/tools/miri/tests/pass/shims/io.rs b/src/tools/miri/tests/pass/shims/io.rs new file mode 100644 index 000000000000..4d43549a930b --- /dev/null +++ b/src/tools/miri/tests/pass/shims/io.rs @@ -0,0 +1,9 @@ +#![feature(is_terminal)] + +use std::io::IsTerminal; + +fn main() { + // We can't really assume that this is truly a terminal, and anyway on Windows Miri will always + // return `false` here, but we can check that the call succeeds. + std::io::stdout().is_terminal(); +}