mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor(NodeItem): replace NodeInfo with NodeEntity
This commit is contained in:
parent
89a3171b58
commit
83dc389d6d
12 changed files with 373 additions and 160 deletions
|
|
@ -140,7 +140,9 @@ class NodeInfoDaoTest {
|
|||
@Test
|
||||
fun testSortByDistance() = runBlocking {
|
||||
val nodes = getNodes(sort = NodeSortOption.DISTANCE)
|
||||
val sortedNodes = nodes.sortedBy { it.distance(ourNode) }
|
||||
val sortedNodes = nodes.sortedWith( // nodes with invalid (null) positions at the end
|
||||
compareBy<NodeEntity> { it.validPosition == null }.thenBy { it.distance(ourNode) }
|
||||
)
|
||||
assertEquals(sortedNodes, nodes)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue