From 1bdd03c18f457f548855a2b2f2e4e2a38adb0978 Mon Sep 17 00:00:00 2001 From: Brian Fopiano Date: Tue, 3 Nov 2026 11:46:21 -0500 Subject: [PATCH] Guard T8 companion test - Run T8's assertions through TongueGuard on ground that keeps tongues --- .../raster/ChunkWaterRasterTest.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/core/src/test/java/art/arcane/iris/generation/hydrology/raster/ChunkWaterRasterTest.java b/core/src/test/java/art/arcane/iris/generation/hydrology/raster/ChunkWaterRasterTest.java index b580c40b8..cb9520fa9 100644 --- a/core/src/test/java/art/arcane/iris/generation/hydrology/raster/ChunkWaterRasterTest.java +++ b/core/src/test/java/art/arcane/iris/generation/hydrology/raster/ChunkWaterRasterTest.java @@ -1284,6 +1284,39 @@ public class ChunkWaterRasterTest { assertTrue("both tongues and horseshoes across seeds: " + tongues + " and " + horseshoes, tongues >= 4 && horseshoes >= 4); } + @Test + public void waterfallBrinkCurvesThroughTheGuardOnGroundThatKeepsItsTongues() { + int natural = 92; + HydrologyTier tier = tier("stream", 4f, 0.5f, 8, IrisBankStyle.SMOOTH); + Reach reach = line(191L, tier, 0L, -20f, 8f, 60f, 30f, (x, z) -> x < 20f ? 90 : 78); + BrinkFrame frame = new BrinkFrame(reach); + int tongues = 0; + int horseshoes = 0; + for (long seed = 1L; seed <= 24L; seed++) { + String label = "seed " + seed + ": "; + Reach kept = TongueGuard.guard(reach, (x, z) -> natural, seed, SEA_LEVEL, seededSettings(seed).deformation().maxFill()); + assertEquals(label + "the guard stops no curve", 0, kept.straightFalls().length); + Scene scene = new Scene(seededSettings(seed), (x, z) -> natural).reach(kept); + double[] positions = new double[7]; + for (int offset = -3; offset <= 3; offset++) { + positions[offset + 3] = frame.rasterBrink(scene, offset); + } + double centre = positions[3]; + double edges = (positions[0] + positions[6]) / 2D; + assertTrue(label + "centre " + centre + " against edges " + edges, Math.abs(centre - edges) >= 1D); + if (centre > edges) { + tongues++; + } else { + horseshoes++; + } + assertEquals(label + "leaks", 0, scene.leaks(-30, -10, 70, 50)); + assertBanksStepOnOneLine(label, frame, scene); + assertRasterFollowsTheRule(label, scene, kept, seed, -30, -10, 70, 50); + assertTheRuleCurvesSmoothly(label, frame, kept, seed); + } + assertTrue("both tongues and horseshoes across seeds: " + tongues + " and " + horseshoes, tongues >= 4 && horseshoes >= 4); + } + @Test public void squareOnBrinkCellsStepAtMostOneBlockBetweenRows() { HydrologyTier tier = tier("stream", 4f, 0.5f, 8, IrisBankStyle.SMOOTH);