From 2bdc925b0f1d2eb60de7598f4c092610a5f0c464 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sun, 21 May 2023 09:51:59 +0200 Subject: [PATCH] Add regression tests to the round Expression function --- .../worldedit/internal/expression/ExpressionTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java index ec175bd72..a1d418f85 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java @@ -449,4 +449,14 @@ class ExpressionTest extends BaseExpressionTest { assertTrue(e.getMessage().contains("Calculations exceeded time limit")); } + @Test + public void testRound() { + checkTestCase("round(1.3)", 1); + checkTestCase("round(0.9)", 1); + checkTestCase("round(-1.1)", -1); + checkTestCase("round(-0.9)", -1); + checkTestCase("round(1.5)", 2); + checkTestCase("round(-1.5)", -1); + } + }