diff --git a/Tests/SwiftProtobufTests/Test_TextFormat_Unknown.swift b/Tests/SwiftProtobufTests/Test_TextFormat_Unknown.swift index e07c3bdeb..42b8db1ac 100644 --- a/Tests/SwiftProtobufTests/Test_TextFormat_Unknown.swift +++ b/Tests/SwiftProtobufTests/Test_TextFormat_Unknown.swift @@ -122,7 +122,7 @@ final class Test_TextFormat_Unknown: XCTestCase, PBTestHelpers { do { let _ = try MessageTestType(textFormatString: text) XCTFail("Shouldn't get here") - } catch TextFormatDecodingError.unknownField { + } catch let error as SwiftProtobufError where self.isSwiftProtobufErrorEqual(error, .TextFormatDecoding.unknownField()) { // This is what should have happened. } @@ -140,7 +140,7 @@ final class Test_TextFormat_Unknown: XCTestCase, PBTestHelpers { do { let _ = try MessageTestType(textFormatString: text) XCTFail("Shouldn't get here") - } catch TextFormatDecodingError.unknownField { + } catch let error as SwiftProtobufError where self.isSwiftProtobufErrorEqual(error, .TextFormatDecoding.unknownField()) { // This is what should have happened. } @@ -175,7 +175,7 @@ final class Test_TextFormat_Unknown: XCTestCase, PBTestHelpers { do { let _ = try MessageTestType(textFormatString: text) XCTFail("Shouldn't get here") - } catch TextFormatDecodingError.unknownField { + } catch let error as SwiftProtobufError where self.isSwiftProtobufErrorEqual(error, .TextFormatDecoding.unknownField()) { // This is what should have happened. }