Skip to content

Commit

Permalink
Remove hashable conformance from MRZResult
Browse files Browse the repository at this point in the history
  • Loading branch information
romanmazeev committed Dec 6, 2023
1 parent d6d24fa commit a39f93e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,6 @@ fastlane/test_output
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

# OS X Finder
.DS_Store
2 changes: 1 addition & 1 deletion Sources/MRZParser/Public/MRZResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public enum MRZFormat: CaseIterable {
}
}

public struct MRZResult: Hashable {
public struct MRZResult {
public enum DocumentType: CaseIterable {
case visa
case passport
Expand Down
18 changes: 18 additions & 0 deletions Tests/MRZParserIntegrationTests/MRZParserIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,21 @@ final class MRZParserTests: XCTestCase {
XCTAssertEqual(parser.parse(mrzString: mrzString), result)
}
}

extension MRZResult: Equatable {
public static func == (lhs: MRZResult, rhs: MRZResult) -> Bool {
lhs.format == rhs.format &&
lhs.documentType == rhs.documentType &&
lhs.documentTypeAdditional == rhs.documentTypeAdditional &&
lhs.countryCode == rhs.countryCode &&
lhs.surnames == rhs.surnames &&
lhs.givenNames == rhs.givenNames &&
lhs.documentNumber == rhs.documentNumber &&
lhs.nationalityCountryCode == rhs.nationalityCountryCode &&
lhs.birthdate == rhs.birthdate &&
lhs.sex == rhs.sex &&
lhs.expiryDate == rhs.expiryDate &&
lhs.optionalData == rhs.optionalData &&
lhs.optionalData2 == rhs.optionalData2
}
}

0 comments on commit a39f93e

Please sign in to comment.