Check file is piped
Improved tests