Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
rui-mo committed Apr 4, 2024
1 parent efb7e77 commit dfa8c16
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions velox/functions/prestosql/tests/DecimalArithmeticTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,14 @@ TEST_F(DecimalArithmeticTest, multiply) {
HugeInt::build(0x08FFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF)},
DECIMAL(38, 0))}),
"Decimal overflow. Value '119630519620642428561342635425231011830' is not in the range of Decimal Type");

// The sum of input scales exceeds result precision.
VELOX_ASSERT_THROW(
evaluate(
"c0 * c0",
makeRowVector(
{makeFlatVector<int128_t>({1000, 2000}, DECIMAL(38, 30))})),
"");
}

TEST_F(DecimalArithmeticTest, decimalDivTest) {
Expand Down

0 comments on commit dfa8c16

Please sign in to comment.