Eliminate explicit control flow in tests