diff --git a/test/Selection.cpp b/test/Selection.cpp index 2a03927b93..1a95fc1825 100644 --- a/test/Selection.cpp +++ b/test/Selection.cpp @@ -162,6 +162,15 @@ void performBrushSelectionTest(const std::string& materialName) performSelectionTest(brush); } +void performPatchSelectionTest(const std::string& materialName) +{ + auto worldspawn = GlobalMapModule().findOrInsertWorldspawn(); + auto patch = algorithm::findFirstPatchWithMaterial(worldspawn, materialName); + EXPECT_TRUE(patch); + + performSelectionTest(patch); +} + TEST_F(SelectionTest, BrushesFacingTowardsXYAreSelectable) { loadMap("selection_test.map"); @@ -177,4 +186,18 @@ TEST_F(SelectionTest, BrushesFacingAwayFromXYAreSelectable) performBrushSelectionTest("textures/numbers/2"); } +TEST_F(SelectionTest, PatchesFacingTowardsXYAreSelectable) +{ + loadMap("selection_test.map"); + + performPatchSelectionTest("textures/numbers/1"); +} + +TEST_F(SelectionTest, PatchesFacingAwayFromXYAreSelectable) +{ + loadMap("selection_test.map"); + + performPatchSelectionTest("textures/numbers/2"); +} + }