tests/events.cpp: support reading documents from stdin