1
0
Fork 0
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:
Heiko Schaefer 2023-06-28 16:19:24 +02:00 committed by Paul Schaub
parent 612ade03c3
commit 84a7469d4f
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -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)
}
}