Skip to content

Commit

Permalink
Merge pull request #600 from siarhei-luskanau/sorted
Browse files Browse the repository at this point in the history
Sort units and actions of ComposePrintToString to stabilize output in Dump screenshots.
  • Loading branch information
takahirom authored Dec 11, 2024
2 parents 0f7ad42 + b87d277 commit bd3804a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ private fun StringBuilder.appendConfigInfo(config: SemanticsConfiguration, inden
// Save space if we there is text only in the object
append(value)
}
} else if (value is Iterable<*>) {
append(value.sortedBy { it.toString() })
} else {
append(value)
}
Expand All @@ -144,15 +146,15 @@ private fun StringBuilder.appendConfigInfo(config: SemanticsConfiguration, inden
appendLine()
append(indent)
append("[")
append(units.joinToString(separator = ", "))
append(units.sorted().joinToString(separator = ", "))
append("]")
}

if (actions.isNotEmpty()) {
appendLine()
append(indent)
append("Actions = [")
append(actions.joinToString(separator = ", "))
append(actions.sorted().joinToString(separator = ", "))
append("]")
}

Expand Down

0 comments on commit bd3804a

Please sign in to comment.