more general test helper