[Test] Fix FileComparisonFailureFirst comparator to keep sorting stability
This commit is contained in:
committed by
teamcityserver
parent
ca40cbede5
commit
17bbedbc50
+7
-2
@@ -76,8 +76,13 @@ object JUnit5Assertions : AssertionsService() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private object FileComparisonFailureFirst : Comparator<Throwable> {
|
private object FileComparisonFailureFirst : Comparator<Throwable> {
|
||||||
override fun compare(o1: Throwable?, o2: Throwable?): Int {
|
override fun compare(o1: Throwable, o2: Throwable): Int {
|
||||||
return if (o1 is FileComparisonFailure) -1 else 0
|
return when {
|
||||||
|
o1 is FileComparisonFailure && o2 is FileComparisonFailure -> 0
|
||||||
|
o1 is FileComparisonFailure -> -1
|
||||||
|
o2 is FileComparisonFailure -> 1
|
||||||
|
else -> 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user