File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,17 @@ fn test_posix_gettimeofday() {
311
311
assert_eq ! ( is_error, -1 ) ;
312
312
}
313
313
314
+ fn test_isatty ( ) {
315
+ // Testing whether our isatty shim returns the right value would require controlling whether
316
+ // these streams are actually TTYs, which is hard.
317
+ // For now, we just check that these calls are supported at all.
318
+ unsafe {
319
+ libc:: isatty ( libc:: STDIN_FILENO ) ;
320
+ libc:: isatty ( libc:: STDOUT_FILENO ) ;
321
+ libc:: isatty ( libc:: STDERR_FILENO ) ;
322
+ }
323
+ }
324
+
314
325
fn main ( ) {
315
326
#[ cfg( any( target_os = "linux" , target_os = "freebsd" ) ) ]
316
327
test_posix_fadvise ( ) ;
@@ -335,4 +346,6 @@ fn main() {
335
346
336
347
#[ cfg( any( target_os = "linux" ) ) ]
337
348
test_clocks ( ) ;
349
+
350
+ test_isatty ( ) ;
338
351
}
You can’t perform that action at this time.
0 commit comments