dragosmg commented on a change in pull request #11790:
URL: https://github.com/apache/arrow/pull/11790#discussion_r759559327



##########
File path: r/tests/testthat/test-data-type.R
##########
@@ -395,6 +395,18 @@ test_that("decimal type and validation", {
   expect_error(decimal(4, NA), '"scale" must be an integer')
 
   expect_r6_class(decimal(4, 2), "Decimal128Type")
+
+  expect_error(decimal128())
+  expect_error(decimal128("four"), '"precision" must be an integer')
+  expect_error(decimal128(4))
+  expect_error(decimal128(4, "two"), '"scale" must be an integer')
+  expect_error(decimal128(NA, 2), '"precision" must be an integer')
+  expect_error(decimal128(0, 2), "Invalid: Decimal precision out of range: 0")
+  expect_error(decimal128(100, 2), "Invalid: Decimal precision out of range: 
100")

Review comment:
       Done. They are tested in the C++ code here: 
https://github.com/apache/arrow/blob/2baed02d259fe3534d20de14af6f7df48611b858/c_glib/test/test-decimal128-data-type.rb#L51




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to