Skip to content

Commit

Permalink
Adding in direct Equatable adherence for legacy versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
GottaGetSwifty committed Mar 4, 2019
1 parent c2a0c15 commit ad550db
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Tests/SWXMLHashTests/TypeConversionBasicTypesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ extension BasicItem: Equatable {
}
}

struct AttributeItem: XMLElementDeserializable, Equatable {
struct AttributeItem: XMLElementDeserializable {
let name: String
let price: Double

Expand All @@ -655,7 +655,13 @@ struct AttributeItem: XMLElementDeserializable, Equatable {
}
}

struct AttributeItemStringRawRepresentable: XMLElementDeserializable, Equatable {
extension AttributeItem: Equatable {
static func == (a: AttributeItem, b: AttributeItem) -> Bool {
return a.name == b.name && a.price == b.price
}
}

struct AttributeItemStringRawRepresentable: XMLElementDeserializable {
private enum Keys: String {
case name
case price
Expand All @@ -673,6 +679,12 @@ struct AttributeItemStringRawRepresentable: XMLElementDeserializable, Equatable
}
}

extension AttributeItemStringRawRepresentable: Equatable {
static func == (a: AttributeItemStringRawRepresentable, b: AttributeItemStringRawRepresentable) -> Bool {
return a.name == b.name && a.price == b.price
}
}

extension TypeConversionBasicTypesTests {
static var allTests: [(String, (TypeConversionBasicTypesTests) -> () throws -> Void)] {
return [
Expand Down

0 comments on commit ad550db

Please sign in to comment.