test stream.when