Skip to content

Commit

Permalink
sort inplace
Browse files Browse the repository at this point in the history
  • Loading branch information
Pgarrett committed Jan 11, 2025
1 parent 89764f7 commit 2c7911a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class SortingHelper {
*/

var comparatorList = listOf(statusCode, coveredTargets)
var restComparator: Comparator<EvaluatedIndividual<*>> = compareBy<EvaluatedIndividual<*>> { ind ->
val restComparator: Comparator<EvaluatedIndividual<*>> = compareBy<EvaluatedIndividual<*>> { ind ->
if (ind.individual is RestIndividual) {
(ind.evaluatedMainActions().last().action as RestCallAction).path.levels()
} else 0
Expand Down Expand Up @@ -266,7 +266,6 @@ class SortingHelper {
*/

return namingStrategy.getSortedTestCases(restComparator)

}

fun sort(solution: Solution<*>, namingStrategy: TestCaseNamingStrategy): List<TestCase> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ open class NumberedTestCaseNamingStrategy(
override fun getSortedTestCases(comparator: Comparator<EvaluatedIndividual<*>>): List<TestCase> {
val inds = solution.individuals

val sortedIndividuals = inds.sortedWith(comparator)
inds.sortWith(comparator)

return generateNames(sortedIndividuals)
return generateNames(inds)
}

// numbered strategy will not expand the name unless it is using the namingHelper
Expand Down

0 comments on commit 2c7911a

Please sign in to comment.