From bed7f97011f87d197e434d33c6385fc2957c9e2d Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Thu, 7 Apr 2022 13:27:07 -0400 Subject: [PATCH] Remove test guards missed in #1236 --- Tests/SwiftProtobufTests/Test_Enum.swift | 44 +++++++++--------- .../SwiftProtobufTests/Test_Enum_Proto2.swift | 46 +++++++++---------- 2 files changed, 43 insertions(+), 47 deletions(-) diff --git a/Tests/SwiftProtobufTests/Test_Enum.swift b/Tests/SwiftProtobufTests/Test_Enum.swift index 8d40a41e7..98644d0b4 100644 --- a/Tests/SwiftProtobufTests/Test_Enum.swift +++ b/Tests/SwiftProtobufTests/Test_Enum.swift @@ -149,28 +149,26 @@ class Test_Enum: XCTestCase, PBTestHelpers { } func testCaseIterable() { - #if swift(>=4.2) - // proto3 syntax enums require the generator to create allCases, - // ensure it is works as expected (order of the file, no aliases). - var i = Protobuf3Unittest_SwiftEnumWithAliasTest.EnumWithAlias.allCases.makeIterator() - guard let e1 = i.next() else { - XCTFail("Couldn't get first value") - return - } - guard let e2 = i.next() else { - XCTFail("Couldn't get second value") - return - } - guard let e3 = i.next() else { - XCTFail("Couldn't get third value") - return - } - // Should be the end. - XCTAssertNil(i.next()) - - XCTAssertEqual(e1, .foo1) - XCTAssertEqual(e2, .baz1) - XCTAssertEqual(e3, .bar1) - #endif + // proto3 syntax enums require the generator to create allCases, + // ensure it is works as expected (order of the file, no aliases). + var i = Protobuf3Unittest_SwiftEnumWithAliasTest.EnumWithAlias.allCases.makeIterator() + guard let e1 = i.next() else { + XCTFail("Couldn't get first value") + return + } + guard let e2 = i.next() else { + XCTFail("Couldn't get second value") + return + } + guard let e3 = i.next() else { + XCTFail("Couldn't get third value") + return + } + // Should be the end. + XCTAssertNil(i.next()) + + XCTAssertEqual(e1, .foo1) + XCTAssertEqual(e2, .baz1) + XCTAssertEqual(e3, .bar1) } } diff --git a/Tests/SwiftProtobufTests/Test_Enum_Proto2.swift b/Tests/SwiftProtobufTests/Test_Enum_Proto2.swift index c538cd86d..88bae9ed1 100644 --- a/Tests/SwiftProtobufTests/Test_Enum_Proto2.swift +++ b/Tests/SwiftProtobufTests/Test_Enum_Proto2.swift @@ -169,29 +169,27 @@ class Test_Enum_Proto2: XCTestCase, PBTestHelpers { } func testCaseIterable() { - #if swift(>=4.2) - // proto2 syntax enums have allCases generated by the compiled, this - // just ensures the generator pereserved the order of the file and - // the handing of aliases doesn't confuse things. - var i = ProtobufUnittest_SwiftEnumWithAliasTest.EnumWithAlias.allCases.makeIterator() - guard let e1 = i.next() else { - XCTFail("Couldn't get first value") - return - } - guard let e2 = i.next() else { - XCTFail("Couldn't get second value") - return - } - guard let e3 = i.next() else { - XCTFail("Couldn't get second value") - return - } - // Should be the end. - XCTAssertNil(i.next()) - - XCTAssertEqual(e1, .foo1) - XCTAssertEqual(e2, .baz1) - XCTAssertEqual(e3, .bar1) - #endif + // proto2 syntax enums have allCases generated by the compiled, this + // just ensures the generator pereserved the order of the file and + // the handing of aliases doesn't confuse things. + var i = ProtobufUnittest_SwiftEnumWithAliasTest.EnumWithAlias.allCases.makeIterator() + guard let e1 = i.next() else { + XCTFail("Couldn't get first value") + return + } + guard let e2 = i.next() else { + XCTFail("Couldn't get second value") + return + } + guard let e3 = i.next() else { + XCTFail("Couldn't get second value") + return + } + // Should be the end. + XCTAssertNil(i.next()) + + XCTAssertEqual(e1, .foo1) + XCTAssertEqual(e2, .baz1) + XCTAssertEqual(e3, .bar1) } }