#![feature(libc)]
extern crate libc;

pub fn readline() -> Option<String> {
    // Buffer to hold readline input
    let buffer = String::new();

    let isatty = unsafe { libc::isatty(libc::STDIN_FILENO as i32) } != 0; 
    if isatty  {
        println!("stdin is a tty");
    } else {
        println!("stdin is not a tty");
    }

    buffer
}

#[test]
fn it_works() {
}

--- 
+++ 
@@ -1,16 +1,3 @@
-#![feature(libc)]
-extern crate libc;
-
-pub fn readline() -> Option<String> {
-    // Buffer to hold readline input
-    let buffer = String::new();
-
-    let isatty = unsafe { libc::isatty(libc::STDIN_FILENO as i32) } != 0; 
-    if isatty  {
-        println!("stdin is a tty");
-    } else {
-        println!("stdin is not a tty");
-    }
-
-    buffer
+#[test]
+fn it_works() {
 }
Check if stdin is from a tty
