tests/parse_text: clean-up the generate_events API