mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-16 01:12:05 +01:00
Add test for Cost
This commit is contained in:
parent
612ade03c3
commit
84a7469d4f
1 changed files with 29 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
|||
// SPDX-FileCopyrightText: 2023 Heiko Schaefer <heiko@schaefer@name>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra
|
||||
|
||||
import kotlin.test.Test
|
||||
|
||||
class CostTest {
|
||||
|
||||
@Test
|
||||
fun cost() {
|
||||
val cost1 = Cost(1, 60)
|
||||
val cost2 = Cost(1, 120)
|
||||
|
||||
val cost3 = Cost(2, 60)
|
||||
val cost4 = Cost(2, 120)
|
||||
|
||||
assert(cost1 < cost2)
|
||||
assert(cost1 > cost3)
|
||||
|
||||
assert(cost2 > cost3)
|
||||
assert(cost3 < cost4)
|
||||
|
||||
assert(cost1 > cost4)
|
||||
assert(cost2 > cost4)
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue