Skip to content

Commit

Permalink
Merge pull request #5229 from matkoniecz/syntax
Browse files Browse the repository at this point in the history
fix test syntax
  • Loading branch information
matkoniecz authored Sep 1, 2023
2 parents 5bf14bf + 8a46729 commit ffb674d
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapEntryAd
import de.westnordost.streetcomplete.quests.TestMapDataWithGeometry
import de.westnordost.streetcomplete.quests.verifyAnswer
import de.westnordost.streetcomplete.testutils.node
import kotlin.test.Assert
import kotlin.test.assertEquals
import kotlin.test.Test

class AddAcceptsCardsTest {
Expand All @@ -27,6 +27,6 @@ class AddAcceptsCardsTest {
node(1, tags = mapOf("shop" to "greengrocer", "name" to "Foobar")),
),
)
Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size)
assertEquals(1, questType.getApplicableElements(mapData).toList().size)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import de.westnordost.streetcomplete.quests.TestMapDataWithGeometry
import de.westnordost.streetcomplete.testutils.node
import de.westnordost.streetcomplete.testutils.p
import de.westnordost.streetcomplete.testutils.way
import kotlin.test.Assert
import kotlin.test.assertEquals
import kotlin.test.Test

class AddDetectBarrierIntersectionTest {
Expand All @@ -14,7 +14,7 @@ class AddDetectBarrierIntersectionTest {
val mapData = TestMapDataWithGeometry(listOf(
node(1)
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

/*
Expand All @@ -31,7 +31,7 @@ class AddDetectBarrierIntersectionTest {
way(1, nodes = listOf(1, 2, 3), tags = mapOf("highway" to "unclassified")),
way(2, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "wall")),
))
Assert.assertEquals(shared, questType.getApplicableElements(mapData).toList().single())
assertEquals(shared, questType.getApplicableElements(mapData).toList().single())
}

/*
Expand All @@ -48,7 +48,7 @@ class AddDetectBarrierIntersectionTest {
way(1, nodes = listOf(1, 2, 3), tags = mapOf("highway" to "unclassified")),
way(2, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "wall")),
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

/*
Expand All @@ -64,7 +64,7 @@ class AddDetectBarrierIntersectionTest {
way(1, nodes = listOf(1, 2), tags = mapOf("highway" to "unclassified")),
way(2, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "fence")),
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

/*
Expand All @@ -80,7 +80,7 @@ class AddDetectBarrierIntersectionTest {
way(1, nodes = listOf(1, 2, 3), tags = mapOf("highway" to "unclassified")),
way(2, nodes = listOf(4, 2), tags = mapOf("barrier" to "city_wall")),
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

/*
Expand All @@ -99,7 +99,7 @@ class AddDetectBarrierIntersectionTest {
way(3, nodes = listOf(4, 2), tags = mapOf("barrier" to "guard_rail")),
way(4, nodes = listOf(2, 5), tags = mapOf("barrier" to "wall"))
))
Assert.assertEquals(shared, questType.getApplicableElements(mapData).toList().single())
assertEquals(shared, questType.getApplicableElements(mapData).toList().single())
}

/*
Expand All @@ -118,7 +118,7 @@ class AddDetectBarrierIntersectionTest {
way(1, nodes = listOf(1, 2, 3), tags = mapOf("highway" to "unclassified")),
way(2, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "fence")),
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

/*
Expand All @@ -137,7 +137,7 @@ class AddDetectBarrierIntersectionTest {
way(1, nodes = listOf(1, 2, 3), tags = mapOf("highway" to "unclassified")),
way(2, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "wall")),
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

/*
Expand All @@ -161,7 +161,7 @@ class AddDetectBarrierIntersectionTest {
way(4, nodes = listOf(6, 2), tags = mapOf("barrier" to "hedge")),
way(5, nodes = listOf(7, 2), tags = mapOf("barrier" to "guard_rail")),
))
Assert.assertEquals(shared, questType.getApplicableElements(mapData).toList().single())
assertEquals(shared, questType.getApplicableElements(mapData).toList().single())
}

/*
Expand All @@ -183,7 +183,7 @@ class AddDetectBarrierIntersectionTest {
way(2, nodes = listOf(4, 2, 5), tags = mapOf("highway" to "unclassified")),
way(3, nodes = listOf(6, 2, 7), tags = mapOf("barrier" to "city_wall")),
))
Assert.assertEquals(shared, questType.getApplicableElements(mapData).toList().single())
assertEquals(shared, questType.getApplicableElements(mapData).toList().single())
}

/*
Expand All @@ -204,6 +204,6 @@ class AddDetectBarrierIntersectionTest {
way(2, nodes = listOf(3, 2), tags = mapOf("highway" to "unclassified")),
way(3, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "retaining_wall")),
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import de.westnordost.streetcomplete.testutils.member
import de.westnordost.streetcomplete.testutils.node
import de.westnordost.streetcomplete.testutils.rel
import de.westnordost.streetcomplete.testutils.way
import kotlin.test.Assert
import kotlin.test.assertEquals
import kotlin.test.Test

class AddBuildingEntranceTest {
Expand Down Expand Up @@ -37,7 +37,7 @@ class AddBuildingEntranceTest {
val mapData = generalTestDataWithWayThroughBuilding(mapOf(
"highway" to "corridor",
))
Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size)
assertEquals(1, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -46,7 +46,7 @@ class AddBuildingEntranceTest {
"highway" to "corridor",
"access" to "private",
))
Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size)
assertEquals(1, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -56,7 +56,7 @@ class AddBuildingEntranceTest {
"indoor" to "yes",
))
// 2 because both ends of way through building generated quest
Assert.assertEquals(2, questType.getApplicableElements(mapData).toList().size)
assertEquals(2, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -65,7 +65,7 @@ class AddBuildingEntranceTest {
"highway" to "footway",
))
// 2 because both ends of way through building generated quest
Assert.assertEquals(2, questType.getApplicableElements(mapData).toList().size)
assertEquals(2, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -74,7 +74,7 @@ class AddBuildingEntranceTest {
"highway" to "footway",
"access" to "private",
))
Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size)
assertEquals(1, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -85,7 +85,7 @@ class AddBuildingEntranceTest {
"highway" to "footway",
"tunnel" to "building_passage",
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -94,7 +94,7 @@ class AddBuildingEntranceTest {
"highway" to "footway",
"covered" to "weird_value",
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -103,7 +103,7 @@ class AddBuildingEntranceTest {
"highway" to "footway",
"tunnel" to "weird_value",
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -123,7 +123,7 @@ class AddBuildingEntranceTest {
)),
),
)
Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size)
assertEquals(1, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -144,7 +144,7 @@ class AddBuildingEntranceTest {
)),
),
)
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -165,7 +165,7 @@ class AddBuildingEntranceTest {
)),
),
)
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -187,7 +187,7 @@ class AddBuildingEntranceTest {
)),
),
)
Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size)
assertEquals(1, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -197,13 +197,13 @@ class AddBuildingEntranceTest {
"highway" to "footway",
"location" to "roof",
))
Assert.assertEquals(0, questType.getApplicableElements(mapDataWithRoof).toList().size)
assertEquals(0, questType.getApplicableElements(mapDataWithRoof).toList().size)

val mapDataWithRooftop = generalTestDataWithWayThroughBuilding(mapOf(
"highway" to "footway",
"location" to "rooftop",
))
Assert.assertEquals(0, questType.getApplicableElements(mapDataWithRooftop).toList().size)
assertEquals(0, questType.getApplicableElements(mapDataWithRooftop).toList().size)
}

@Test
Expand All @@ -226,7 +226,7 @@ class AddBuildingEntranceTest {
)),
),
)
Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size)
assertEquals(1, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -249,6 +249,6 @@ class AddBuildingEntranceTest {
way(3L, listOf(3, 4)),
),
)
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import de.westnordost.streetcomplete.testutils.member
import de.westnordost.streetcomplete.testutils.node
import de.westnordost.streetcomplete.testutils.rel
import de.westnordost.streetcomplete.testutils.way
import kotlin.test.Assert
import kotlin.test.Test
import kotlin.test.assertEquals

class AddBuildingEntranceReferenceTest {

Expand All @@ -29,7 +29,7 @@ class AddBuildingEntranceReferenceTest {
way(2L, listOf(2, 20), mapOf("highway" to "footway")),
),
)
Assert.assertEquals(2, questType.getApplicableElements(mapData).toList().size)
assertEquals(2, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -52,7 +52,7 @@ class AddBuildingEntranceReferenceTest {
way(201L, listOf(5, 20), mapOf("highway" to "footway")),
),
)
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -71,7 +71,7 @@ class AddBuildingEntranceReferenceTest {
way(2L, listOf(2, 20), mapOf("highway" to "footway", "access" to "no")),
),
)
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -90,7 +90,7 @@ class AddBuildingEntranceReferenceTest {
)),
),
)
Assert.assertEquals(2, questType.getApplicableElements(mapData).toList().size)
assertEquals(2, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -108,6 +108,6 @@ class AddBuildingEntranceReferenceTest {
)),
),
)
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapEntryAd
import de.westnordost.streetcomplete.quests.TestMapDataWithGeometry
import de.westnordost.streetcomplete.quests.verifyAnswer
import de.westnordost.streetcomplete.testutils.way
import kotlin.test.Assert
import kotlin.test.assertEquals
import kotlin.test.Test

class AddBuildingLevelsTest {
Expand Down Expand Up @@ -46,7 +46,7 @@ class AddBuildingLevelsTest {
"building" to "industrial"
))
))
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}

@Test fun `applicable to residential buildings`() {
Expand All @@ -55,6 +55,6 @@ class AddBuildingLevelsTest {
"building" to "residential"
))
))
Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size)
assertEquals(1, questType.getApplicableElements(mapData).toList().size)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package de.westnordost.streetcomplete.quests.drinking_water

import de.westnordost.streetcomplete.quests.TestMapDataWithGeometry

Check failure on line 3 in app/src/test/java/de/westnordost/streetcomplete/quests/drinking_water/AddDrinkingWaterTest.kt

View workflow job for this annotation

GitHub Actions / Kotlin

Imports must be ordered in lexicographic order without any empty lines in-between with "java", "javax", "kotlin" and aliases in the end
import de.westnordost.streetcomplete.testutils.node
import kotlin.test.Assert
import kotlin.test.assertEquals
import kotlin.test.Test

class AddDrinkingWaterTest {
Expand All @@ -15,7 +15,7 @@ class AddDrinkingWaterTest {
node(1, tags = mapOf("natural" to "spring")),
),
)
Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size)
assertEquals(1, questType.getApplicableElements(mapData).toList().size)
}

@Test
Expand All @@ -25,6 +25,6 @@ class AddDrinkingWaterTest {
node(1, tags = mapOf("natural" to "spring", "access" to "no")),
),
)
Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size)
assertEquals(0, questType.getApplicableElements(mapData).toList().size)
}
}
Loading

0 comments on commit ffb674d

Please sign in to comment.