1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-17 09:04:50 +02:00

Add test for Cost

This commit is contained in:
Heiko Schaefer 2023-06-28 16:19:24 +02:00
parent 5b18a1b465
commit 1005be095f
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

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