mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-15 17:02:06 +01:00
Add test for Cost
This commit is contained in:
parent
5b18a1b465
commit
1005be095f
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