Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions R/pkg/tests/fulltests/test_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ test_that("cleanClosure on R functions", {
lapply(x, g) + 1 # Test for capturing function call "g"'s closure as a argument of lapply.
l$field[1, 1] <- 3 # Test for access operators `$`.
res <- defUse + l$field[1, ] # Test for def-use chain of "defUse", and "" symbol.
f(res) # Test for recursive calls.
# Enable once SPARK-30629 is fixed
# nolint start
# f(res) # Test for recursive calls.
# nolint end
}
newF <- cleanClosure(f)
env <- environment(newF)
Expand All @@ -101,7 +104,10 @@ test_that("cleanClosure on R functions", {
# nolint end
expect_true("g" %in% ls(env))
expect_true("l" %in% ls(env))
expect_true("f" %in% ls(env))
# Enable once SPARK-30629 is fixed
# nolint start
# expect_true("f" %in% ls(env))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember codes in comments break one of the R linter rule. Might be good to double check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They do, that's why it is wrapped with nolint. If I didn't mess up anything, this is cherry picked from previous version of SPARK-23435 proposal, and already passed all tests, but let's see how it goes.

# nolint end
expect_equal(get("l", envir = env, inherits = FALSE), l)
# "y" should be in the environment of g.
newG <- get("g", envir = env, inherits = FALSE)
Expand Down