Add forEach tests to ensure length is computed before iteration.