fix up the tests

also add debug code for verifying stdin's filetype

it could be a regular file if it's redirected input or it could be a
character device if it's regular stdin or a fifo if it's an actual pipe