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() {
311311 assert_eq ! ( is_error, -1 ) ;
312312}
313313
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+
314325fn main ( ) {
315326 #[ cfg( any( target_os = "linux" , target_os = "freebsd" ) ) ]
316327 test_posix_fadvise ( ) ;
@@ -335,4 +346,6 @@ fn main() {
335346
336347 #[ cfg( any( target_os = "linux" ) ) ]
337348 test_clocks ( ) ;
349+
350+ test_isatty ( ) ;
338351}
You can’t perform that action at this time.
0 commit comments