Make tests for '%run -m' more robust