diff --git a/item/base/src/test/java/it/angrybear/yagl/items/recipes/ShapeTest.java b/item/base/src/test/java/it/angrybear/yagl/items/recipes/ShapeTest.java index b42eb158..f9ffce99 100644 --- a/item/base/src/test/java/it/angrybear/yagl/items/recipes/ShapeTest.java +++ b/item/base/src/test/java/it/angrybear/yagl/items/recipes/ShapeTest.java @@ -6,6 +6,18 @@ class ShapeTest { + @Test + void shapesShouldOnlyEqualWithSameRowsAndColumns() { + ShapedRecipe.Shape s1 = new ShapedRecipe.Shape(3, 2); + ShapedRecipe.Shape s2 = new ShapedRecipe.Shape(3, 2); + ShapedRecipe.Shape s3 = new ShapedRecipe.Shape(2, 3); + + assertEquals(s1, s2); + assertEquals(s1.hashCode(), s2.hashCode()); + assertNotEquals(s1, s3); + assertNotEquals(s1.hashCode(), s3.hashCode()); + } + @Test void testColumnsBounds() { assertThrowsExactly(IllegalArgumentException.class, () ->