@@ -1951,14 +1951,23 @@ public func checkEquatable<Instances : Collection>(
1951
1951
let y = instances [ j]
1952
1952
1953
1953
let xy = x == y
1954
- expectEqual ( predictedXY, xy, ${ trace} )
1954
+ expectEqual (
1955
+ predictedXY, xy,
1956
+ " lhs (at index \( i) ): \( x) \n rhs (at index \( j) ): \( y) " ,
1957
+ stackTrace: ${ stackTrace} )
1955
1958
1956
1959
// Not-equal is an inverse of equal
1957
- expectNotEqual ( xy, x != y, ${ trace} )
1958
-
1960
+ expectNotEqual (
1961
+ xy, x != y,
1962
+ " lhs (at index \( i) ): \( x) \n rhs (at index \( j) ): \( y) " ,
1963
+ stackTrace: ${ stackTrace} )
1964
+
1959
1965
// Symmetry
1960
- expectEqual ( xy, y == x, ${ trace} )
1961
-
1966
+ expectEqual (
1967
+ xy, y == x,
1968
+ " lhs (at index \( i) ): \( x) \n rhs (at index \( j) ): \( y) " ,
1969
+ stackTrace: ${ stackTrace} )
1970
+
1962
1971
for k in instances. indices {
1963
1972
let z = instances [ k]
1964
1973
// Transitivity
@@ -1998,10 +2007,15 @@ public func checkHashable<Instances : Collection>(
1998
2007
1999
2008
checkEquatable ( instances, oracle: equalityOracle, ${ trace} )
2000
2009
2001
- for x in instances {
2002
- for y in instances {
2010
+ for i in instances. indices {
2011
+ let x = instances [ i]
2012
+ for j in instances. indices {
2013
+ let y = instances [ j]
2003
2014
if x == y {
2004
- expectEqual ( x. hashValue, y. hashValue, ${ trace} )
2015
+ expectEqual (
2016
+ x. hashValue, y. hashValue,
2017
+ " lhs (at index \( i) ): \( x) \n rhs (at index \( j) ): \( y) " ,
2018
+ stackTrace: ${ stackTrace} )
2005
2019
}
2006
2020
}
2007
2021
}
0 commit comments