We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
test_ttyname_ok
1 parent aee5b09 commit f416b6bCopy full SHA for f416b6b
tests/termios/ttyname.rs
@@ -4,7 +4,11 @@ use std::fs::File;
4
5
#[test]
6
fn test_ttyname_ok() {
7
- let file = File::open("/dev/stdin").unwrap();
+ let file = match File::open("/dev/stdin") {
8
+ Ok(file) => file,
9
+ Err(err) if err.kind() == std::io::ErrorKind::PermissionDenied => return,
10
+ Err(err) => Err(err).unwrap(),
11
+ };
12
if isatty(&file) {
13
assert!(ttyname(&file, Vec::new())
14
.unwrap()
0 commit comments