pull dirty test code out, make EOF work correctly for buffered charstream