Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ public func expectOptionalEqual${Generic}(

%end

public func expectEqual(
_ expected: Any.Type, _ actual: Any.Type, ${TRACE}
) {
expectEqualTest(expected, actual, ${trace}, showFrame: false) { $0 == $1 }
}

public func expectLT<T : Comparable>(_ lhs: T, _ rhs: T, ${TRACE}) {
if !(lhs < rhs) {
expectationFailure("\(lhs) < \(rhs)", trace: ${trace})
Expand Down
12 changes: 6 additions & 6 deletions test/1_stdlib/TestAffineTransform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ class TestAffineTransform : TestAffineTransformSuper {
AffineTransform(m11: -55.66, m12: 22.7, m21: 1.5, m22: 0.0, tX: -22, tY: -33)
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("AffineTransform", String(describing: type(of: anyHashables[0].base)))
expectEqual("AffineTransform", String(describing: type(of: anyHashables[1].base)))
expectEqual("AffineTransform", String(describing: type(of: anyHashables[2].base)))
expectEqual(AffineTransform.self, type(of: anyHashables[0].base))
expectEqual(AffineTransform.self, type(of: anyHashables[1].base))
expectEqual(AffineTransform.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -356,9 +356,9 @@ class TestAffineTransform : TestAffineTransformSuper {
makeNSAffineTransform(rotatedByDegrees: 10),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("AffineTransform", String(describing: type(of: anyHashables[0].base)))
expectEqual("AffineTransform", String(describing: type(of: anyHashables[1].base)))
expectEqual("AffineTransform", String(describing: type(of: anyHashables[2].base)))
expectEqual(AffineTransform.self, type(of: anyHashables[0].base))
expectEqual(AffineTransform.self, type(of: anyHashables[1].base))
expectEqual(AffineTransform.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
12 changes: 6 additions & 6 deletions test/1_stdlib/TestCalendar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ class TestCalendar : TestCalendarSuper {
Calendar(identifier: .japanese)
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("Calendar", String(describing: type(of: anyHashables[0].base)))
expectEqual("Calendar", String(describing: type(of: anyHashables[1].base)))
expectEqual("Calendar", String(describing: type(of: anyHashables[2].base)))
expectEqual(Calendar.self, type(of: anyHashables[0].base))
expectEqual(Calendar.self, type(of: anyHashables[1].base))
expectEqual(Calendar.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -278,9 +278,9 @@ class TestCalendar : TestCalendarSuper {
NSCalendar(identifier: .japanese)!,
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("Calendar", String(describing: type(of: anyHashables[0].base)))
expectEqual("Calendar", String(describing: type(of: anyHashables[1].base)))
expectEqual("Calendar", String(describing: type(of: anyHashables[2].base)))
expectEqual(Calendar.self, type(of: anyHashables[0].base))
expectEqual(Calendar.self, type(of: anyHashables[1].base))
expectEqual(Calendar.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
12 changes: 6 additions & 6 deletions test/1_stdlib/TestCharacterSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ class TestCharacterSet : TestCharacterSetSuper {
CharacterSet(charactersIn: "XYZ")
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("CharacterSet", String(describing: type(of: anyHashables[0].base)))
expectEqual("CharacterSet", String(describing: type(of: anyHashables[1].base)))
expectEqual("CharacterSet", String(describing: type(of: anyHashables[2].base)))
expectEqual(CharacterSet.self, type(of: anyHashables[0].base))
expectEqual(CharacterSet.self, type(of: anyHashables[1].base))
expectEqual(CharacterSet.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -174,9 +174,9 @@ class TestCharacterSet : TestCharacterSetSuper {
NSCharacterSet(charactersIn: "XYZ"),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("CharacterSet", String(describing: type(of: anyHashables[0].base)))
expectEqual("CharacterSet", String(describing: type(of: anyHashables[1].base)))
expectEqual("CharacterSet", String(describing: type(of: anyHashables[2].base)))
expectEqual(CharacterSet.self, type(of: anyHashables[0].base))
expectEqual(CharacterSet.self, type(of: anyHashables[1].base))
expectEqual(CharacterSet.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
12 changes: 6 additions & 6 deletions test/1_stdlib/TestData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -875,9 +875,9 @@ class TestData : TestDataSuper {
Data(base64Encoded: "AAAB")!,
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("Data", String(describing: type(of: anyHashables[0].base)))
expectEqual("Data", String(describing: type(of: anyHashables[1].base)))
expectEqual("Data", String(describing: type(of: anyHashables[2].base)))
expectEqual(Data.self, type(of: anyHashables[0].base))
expectEqual(Data.self, type(of: anyHashables[1].base))
expectEqual(Data.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -889,9 +889,9 @@ class TestData : TestDataSuper {
NSData(base64Encoded: "AAAB")!,
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("Data", String(describing: type(of: anyHashables[0].base)))
expectEqual("Data", String(describing: type(of: anyHashables[1].base)))
expectEqual("Data", String(describing: type(of: anyHashables[2].base)))
expectEqual(Data.self, type(of: anyHashables[0].base))
expectEqual(Data.self, type(of: anyHashables[1].base))
expectEqual(Data.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
24 changes: 12 additions & 12 deletions test/1_stdlib/TestDate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ class TestDate : TestDateSuper {
dateWithString("2010-05-17 14:49:47 -0700"),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("Date", String(describing: type(of: anyHashables[0].base)))
expectEqual("Date", String(describing: type(of: anyHashables[1].base)))
expectEqual("Date", String(describing: type(of: anyHashables[2].base)))
expectEqual(Date.self, type(of: anyHashables[0].base))
expectEqual(Date.self, type(of: anyHashables[1].base))
expectEqual(Date.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -157,9 +157,9 @@ class TestDate : TestDateSuper {
NSDate(timeIntervalSince1970: 1000000001),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("Date", String(describing: type(of: anyHashables[0].base)))
expectEqual("Date", String(describing: type(of: anyHashables[1].base)))
expectEqual("Date", String(describing: type(of: anyHashables[2].base)))
expectEqual(Date.self, type(of: anyHashables[0].base))
expectEqual(Date.self, type(of: anyHashables[1].base))
expectEqual(Date.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -171,9 +171,9 @@ class TestDate : TestDateSuper {
DateComponents(year: 1995),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("DateComponents", String(describing: type(of: anyHashables[0].base)))
expectEqual("DateComponents", String(describing: type(of: anyHashables[1].base)))
expectEqual("DateComponents", String(describing: type(of: anyHashables[2].base)))
expectEqual(DateComponents.self, type(of: anyHashables[0].base))
expectEqual(DateComponents.self, type(of: anyHashables[1].base))
expectEqual(DateComponents.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -190,9 +190,9 @@ class TestDate : TestDateSuper {
makeNSDateComponents(year: 1995),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("DateComponents", String(describing: type(of: anyHashables[0].base)))
expectEqual("DateComponents", String(describing: type(of: anyHashables[1].base)))
expectEqual("DateComponents", String(describing: type(of: anyHashables[2].base)))
expectEqual(DateComponents.self, type(of: anyHashables[0].base))
expectEqual(DateComponents.self, type(of: anyHashables[1].base))
expectEqual(DateComponents.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
12 changes: 6 additions & 6 deletions test/1_stdlib/TestDateInterval.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ class TestDateInterval : TestDateIntervalSuper {
DateInterval(start: start, duration: duration / 2),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("DateInterval", String(describing: type(of: anyHashables[0].base)))
expectEqual("DateInterval", String(describing: type(of: anyHashables[1].base)))
expectEqual("DateInterval", String(describing: type(of: anyHashables[2].base)))
expectEqual(DateInterval.self, type(of: anyHashables[0].base))
expectEqual(DateInterval.self, type(of: anyHashables[1].base))
expectEqual(DateInterval.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -158,9 +158,9 @@ class TestDateInterval : TestDateIntervalSuper {
NSDateInterval(start: start, duration: duration / 2),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("DateInterval", String(describing: type(of: anyHashables[0].base)))
expectEqual("DateInterval", String(describing: type(of: anyHashables[1].base)))
expectEqual("DateInterval", String(describing: type(of: anyHashables[2].base)))
expectEqual(DateInterval.self, type(of: anyHashables[0].base))
expectEqual(DateInterval.self, type(of: anyHashables[1].base))
expectEqual(DateInterval.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
12 changes: 6 additions & 6 deletions test/1_stdlib/TestIndexPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ class TestIndexPath : TestIndexPathSuper {
IndexPath(indexes: [1, 2, 3]),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("IndexPath", String(describing: type(of: anyHashables[0].base)))
expectEqual("IndexPath", String(describing: type(of: anyHashables[1].base)))
expectEqual("IndexPath", String(describing: type(of: anyHashables[2].base)))
expectEqual(IndexPath.self, type(of: anyHashables[0].base))
expectEqual(IndexPath.self, type(of: anyHashables[1].base))
expectEqual(IndexPath.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -103,9 +103,9 @@ class TestIndexPath : TestIndexPathSuper {
NSIndexPath(index: 2),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("IndexPath", String(describing: type(of: anyHashables[0].base)))
expectEqual("IndexPath", String(describing: type(of: anyHashables[1].base)))
expectEqual("IndexPath", String(describing: type(of: anyHashables[2].base)))
expectEqual(IndexPath.self, type(of: anyHashables[0].base))
expectEqual(IndexPath.self, type(of: anyHashables[1].base))
expectEqual(IndexPath.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
12 changes: 6 additions & 6 deletions test/1_stdlib/TestIndexSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,9 @@ class TestIndexSet : TestIndexSetSuper {
IndexSet([0, 1, 2]),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("IndexSet", String(describing: type(of: anyHashables[0].base)))
expectEqual("IndexSet", String(describing: type(of: anyHashables[1].base)))
expectEqual("IndexSet", String(describing: type(of: anyHashables[2].base)))
expectEqual(IndexSet.self, type(of: anyHashables[0].base))
expectEqual(IndexSet.self, type(of: anyHashables[1].base))
expectEqual(IndexSet.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -813,9 +813,9 @@ class TestIndexSet : TestIndexSetSuper {
NSIndexSet(index: 1),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("IndexSet", String(describing: type(of: anyHashables[0].base)))
expectEqual("IndexSet", String(describing: type(of: anyHashables[1].base)))
expectEqual("IndexSet", String(describing: type(of: anyHashables[2].base)))
expectEqual(IndexSet.self, type(of: anyHashables[0].base))
expectEqual(IndexSet.self, type(of: anyHashables[1].base))
expectEqual(IndexSet.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
12 changes: 6 additions & 6 deletions test/1_stdlib/TestLocale.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ class TestLocale : TestLocaleSuper {
Locale(identifier: "uk"),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("Locale", String(describing: type(of: anyHashables[0].base)))
expectEqual("Locale", String(describing: type(of: anyHashables[1].base)))
expectEqual("Locale", String(describing: type(of: anyHashables[2].base)))
expectEqual(Locale.self, type(of: anyHashables[0].base))
expectEqual(Locale.self, type(of: anyHashables[1].base))
expectEqual(Locale.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -130,9 +130,9 @@ class TestLocale : TestLocaleSuper {
NSLocale(localeIdentifier: "uk"),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("Locale", String(describing: type(of: anyHashables[0].base)))
expectEqual("Locale", String(describing: type(of: anyHashables[1].base)))
expectEqual("Locale", String(describing: type(of: anyHashables[2].base)))
expectEqual(Locale.self, type(of: anyHashables[0].base))
expectEqual(Locale.self, type(of: anyHashables[1].base))
expectEqual(Locale.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
12 changes: 6 additions & 6 deletions test/1_stdlib/TestPersonNameComponents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class TestPersonNameComponents : TestPersonNameComponentsSuper {
makePersonNameComponents(givenName: "John", familyName: "Appleseed"),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("PersonNameComponents", String(describing: type(of: anyHashables[0].base)))
expectEqual("PersonNameComponents", String(describing: type(of: anyHashables[1].base)))
expectEqual("PersonNameComponents", String(describing: type(of: anyHashables[2].base)))
expectEqual(PersonNameComponents.self, type(of: anyHashables[0].base))
expectEqual(PersonNameComponents.self, type(of: anyHashables[1].base))
expectEqual(PersonNameComponents.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -61,9 +61,9 @@ class TestPersonNameComponents : TestPersonNameComponentsSuper {
makeNSPersonNameComponents(givenName: "John", familyName: "Appleseed"),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("PersonNameComponents", String(describing: type(of: anyHashables[0].base)))
expectEqual("PersonNameComponents", String(describing: type(of: anyHashables[1].base)))
expectEqual("PersonNameComponents", String(describing: type(of: anyHashables[2].base)))
expectEqual(PersonNameComponents.self, type(of: anyHashables[0].base))
expectEqual(PersonNameComponents.self, type(of: anyHashables[1].base))
expectEqual(PersonNameComponents.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
12 changes: 6 additions & 6 deletions test/1_stdlib/TestTimeZone.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class TestTimeZone : TestTimeZoneSuper {
TimeZone(identifier: "Europe/Kiev")!,
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("TimeZone", String(describing: type(of: anyHashables[0].base)))
expectEqual("TimeZone", String(describing: type(of: anyHashables[1].base)))
expectEqual("TimeZone", String(describing: type(of: anyHashables[2].base)))
expectEqual(TimeZone.self, type(of: anyHashables[0].base))
expectEqual(TimeZone.self, type(of: anyHashables[1].base))
expectEqual(TimeZone.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand All @@ -84,9 +84,9 @@ class TestTimeZone : TestTimeZoneSuper {
NSTimeZone(name: "Europe/Kiev")!,
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("TimeZone", String(describing: type(of: anyHashables[0].base)))
expectEqual("TimeZone", String(describing: type(of: anyHashables[1].base)))
expectEqual("TimeZone", String(describing: type(of: anyHashables[2].base)))
expectEqual(TimeZone.self, type(of: anyHashables[0].base))
expectEqual(TimeZone.self, type(of: anyHashables[1].base))
expectEqual(TimeZone.self, type(of: anyHashables[2].base))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
Loading