We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd291ac commit a822e52Copy full SHA for a822e52
tests/termios/ttyname.rs
@@ -1,15 +1,17 @@
1
use rustix::io;
2
-use rustix::termios::ttyname;
+use rustix::termios::{isatty, ttyname};
3
use std::fs::File;
4
5
#[test]
6
fn test_ttyname_ok() {
7
let file = File::open("/dev/stdin").unwrap();
8
- assert!(ttyname(&file, Vec::new())
9
- .unwrap()
10
- .into_string()
11
12
- .starts_with("/dev/"));
+ if isatty(&file) {
+ assert!(ttyname(&file, Vec::new())
+ .unwrap()
+ .into_string()
13
+ .starts_with("/dev/"));
14
+ }
15
}
16
17
0 commit comments