Skip to content

Commit

Permalink
Merge branch 'praszuk/feat/change-building-yes-value-simplification' …
Browse files Browse the repository at this point in the history
…into v2.0.0
  • Loading branch information
praszuk committed Sep 7, 2024
2 parents 69b984a + bac0c52 commit b82cc08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ public static boolean isBuildingValueSimplification(@Nonnull OsmPrimitive curren
if (newValue == null) {
return true;
}
if (newValue.equals(currentValue)) {
return false;
}

if (newValue.equals("house") && HOUSE_DETAILS.contains(currentValue)) {
if (newValue.equals("yes") && !currentValue.equals("construction")) {
return true;
}
else if (newValue.equals("house") && HOUSE_DETAILS.contains(currentValue)) {
return true;
}
else if (newValue.equals("residential") && LIVING_BUILDINGS.contains(currentValue)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ void testNewPrimitiveEmptyValue() {
"detached,house", "semidetached_house,house",
"house,residential", "detached,residential",
"garage,outbuilding", "barn,outbuilding",
"house,yes", "outbuilding,yes"
})
void testNewPrimitiveHasSimplifiedBuildingValue(String selectedValue, String newPrimitiveValue) {
OsmPrimitive selected = new Way();
Expand All @@ -45,7 +46,7 @@ void testNewPrimitiveHasSimplifiedBuildingValue(String selectedValue, String new
}

@ParameterizedTest
@CsvSource({"yes,house", "house,detached", "residential,house", "yes,outbuilding"})
@CsvSource({"house,detached", "residential,house", "construction,yes", "yes,yes"})
public void testNewPrimitiveHasNotSimplifiedBuildingValue(String selectedValue, String newPrimitiveValue) {
OsmPrimitive selected = new Way();
OsmPrimitive newPrimitive = new Way();
Expand Down

0 comments on commit b82cc08

Please sign in to comment.