From 9bbb152b4a386c6607bde4dc67ff48c17ac16e1f Mon Sep 17 00:00:00 2001 From: LinuxHeki Date: Sat, 20 May 2023 15:36:45 +0200 Subject: [PATCH] add tests for math::abs --- tests/integration.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index e6c114e..ab0bfe4 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -363,6 +363,9 @@ fn test_builtin_functions() { eval("math::hypot(8.2, 1.1)"), Ok(Value::Float((8.2 as FloatType).hypot(1.1))) ); + // Absolute + assert_eq!(eval("math::abs(15)"), Ok(Value::Float(15.0))); + assert_eq!(eval("math::abs(-15)"), Ok(Value::Float(15.0))); // Rounding assert_eq!(eval("floor(1.1)"), Ok(Value::Float(1.0))); assert_eq!(eval("floor(1.9)"), Ok(Value::Float(1.0)));