mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-20 14:57:15 -04:00
[index] fix screenshot sorting for tests
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.fdroid.test
|
||||
|
||||
import org.fdroid.index.v2.IndexV2
|
||||
import org.fdroid.index.v2.LocalizedFileListV2
|
||||
import org.fdroid.index.v2.MetadataV2
|
||||
import org.fdroid.index.v2.Screenshots
|
||||
import kotlin.random.Random
|
||||
@@ -65,11 +66,15 @@ public object TestUtils {
|
||||
)
|
||||
|
||||
public fun Screenshots.sort(): Screenshots = copy(
|
||||
phone = phone?.toSortedMap(),
|
||||
sevenInch = sevenInch?.toSortedMap(),
|
||||
tenInch = tenInch?.toSortedMap(),
|
||||
wear = wear?.toSortedMap(),
|
||||
tv = tv?.toSortedMap(),
|
||||
phone = phone?.sort(),
|
||||
sevenInch = sevenInch?.sort(),
|
||||
tenInch = tenInch?.sort(),
|
||||
wear = wear?.sort(),
|
||||
tv = tv?.sort(),
|
||||
)
|
||||
|
||||
public fun LocalizedFileListV2.sort(): LocalizedFileListV2 {
|
||||
return toSortedMap().mapValues { entry -> entry.value.sortedBy { it.name } }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user