test readline function