Skip to content

Commit 08139a3

Browse files
committed
add tests
1 parent a0dd4bd commit 08139a3

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

R/pkg/inst/tests/testthat/test_Serde.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ test_that("SerDe of primitive types", {
2828
expect_equal(x, 1)
2929
expect_equal(class(x), "numeric")
3030

31+
x <- callJStatic("SparkRHandler", "echo", 1380742793415240)
32+
expect_equal(x, 1380742793415240)
33+
expect_equal(class(x), "numeric")
34+
3135
x <- callJStatic("SparkRHandler", "echo", TRUE)
3236
expect_true(x)
3337
expect_equal(class(x), "logical")
@@ -43,6 +47,11 @@ test_that("SerDe of list of primitive types", {
4347
expect_equal(x, y)
4448
expect_equal(class(y[[1]]), "integer")
4549

50+
x <- list(1380742793415240, 13807427934152401, 13807427934152402)
51+
y <- callJStatic("SparkRHandler", "echo", x)
52+
expect_equal(x, y)
53+
expect_equal(class(y[[1]]), "numeric")
54+
4655
x <- list(1, 2, 3)
4756
y <- callJStatic("SparkRHandler", "echo", x)
4857
expect_equal(x, y)
@@ -66,7 +75,8 @@ test_that("SerDe of list of primitive types", {
6675

6776
test_that("SerDe of list of lists", {
6877
x <- list(list(1L, 2L, 3L), list(1, 2, 3),
69-
list(TRUE, FALSE), list("a", "b", "c"))
78+
list(TRUE, FALSE), list("a", "b", "c"),
79+
list(1380742793415240, 1380742793415240))
7080
y <- callJStatic("SparkRHandler", "echo", x)
7181
expect_equal(x, y)
7282

R/pkg/inst/tests/testthat/test_sparkSQL.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3202,8 +3202,7 @@ test_that("dapply with bigint type", {
32023202
},
32033203
schema)
32043204
result <- collect(df1)
3205-
resultString <- sprintf("%.10f", result$a[1])
3206-
expect_equal(resultString, "1380742793415240.0000000000")
3205+
expect_equal(result$a[1], 1380742793415240)
32073206
})
32083207

32093208
test_that("catalog APIs, listTables, listColumns, listFunctions", {

0 commit comments

Comments
 (0)