From acde179deac7266c5091bea7ab093c7736968501 Mon Sep 17 00:00:00 2001 From: PHILO-HE Date: Tue, 28 Mar 2023 14:20:24 +0800 Subject: [PATCH] Add some test --- velox/functions/sparksql/tests/ArithmeticTest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/velox/functions/sparksql/tests/ArithmeticTest.cpp b/velox/functions/sparksql/tests/ArithmeticTest.cpp index 886123b2d05e0..aa14a8f57b926 100644 --- a/velox/functions/sparksql/tests/ArithmeticTest.cpp +++ b/velox/functions/sparksql/tests/ArithmeticTest.cpp @@ -67,6 +67,16 @@ TEST_F(PmodTest, int64) { EXPECT_EQ(INT64_MAX - 1, pmod(INT64_MIN, INT64_MAX)); } +TEST_F(PmodTest, float) { + EXPECT_EQ(0.2, pmod(0.5, 0.3)); + EXPECT_EQ(0.9, pmod(-1.1, 2)); +} + +TEST_F(PmodTest, double) { + EXPECT_EQ(0.2, pmod(0.5, 0.3)); + EXPECT_EQ(0.9, pmod(-1.1, 2)); +} + class RemainderTest : public SparkFunctionBaseTest { protected: template