Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed May 23, 2024
1 parent 875a4fe commit 27af094
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ fun isSurfaceAndTracktypeConflicting(surface: String, tracktype: String?): Boole
INVALID_SURFACES_FOR_TRACKTYPES[tracktype]?.contains(surface) == true

private val EXPECTED_SURFACES_FOR_TRACKTYPES = mapOf(
"grade1" to PAVED_SURFACES + setOf("stone", "rock", "ice"), // natural solid surfaces are fine too
"grade2" to UNPAVED_SURFACES + PAVED_SURFACES - SOFT_TRACK_SURFACES, // could be basically anything except soft surfaces
// natural solid surfaces are fine too
"grade1" to PAVED_SURFACES + setOf("stone", "rock", "ice"),
// anything not soft or not fully paved
"grade2" to UNPAVED_SURFACES + PAVED_SURFACES - SOFT_TRACK_SURFACES - FULLY_PAVED_SURFACES,
"grade3" to UNPAVED_SURFACES,
"grade4" to UNPAVED_SURFACES,
"grade5" to SOFT_TRACK_SURFACES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class SurfaceUtilsKtTest {
}

@Test fun `high quality tracktype conflicts with poor surface`() {
assertTrue(isSurfaceAndTracktypeConflicting("gravel", "grade1"))
assertTrue(isSurfaceAndTracktypeCombinationSuspicious("gravel", "grade1"))
assertTrue(isSurfaceAndTracktypeConflicting("earth", "grade1"))
assertTrue(isSurfaceAndTracktypeCombinationSuspicious("earth", "grade1"))
}

@Test fun `high quality tracktype fits good surface`() {
Expand Down

0 comments on commit 27af094

Please sign in to comment.