Skip to content

Commit

Permalink
Update tests/testthat/test-code_dependency.R
Browse files Browse the repository at this point in the history
Co-authored-by: Dawid Kałędkowski <[email protected]>
Signed-off-by: Marcin <[email protected]>
  • Loading branch information
m7pr and gogonzo authored Oct 6, 2023
1 parent ce8d27a commit bac6699
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/test-code_dependency.R
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,18 @@ testthat::test_that("get_code understands $ usage and do not treat rhs of $ as o
)
})

testthat::test_that("get_code detects cooccurrence properly even if all objects are on rhs", {
q <- new_qenv()
q <- eval_code(q, "a <- 1")
q <- eval_code(q, "b <- list(c = 2)")
q <- eval_code(q, "b[[a]] <- 3")

testthat::expect_identical(
get_code(q, names = "b"),
c("a <- 1", "b <- list(c = 2)", "b[[a]] <- 3")
)
})


# @ ---------------------------------------------------------------------------------------------------------------

Expand Down

0 comments on commit bac6699

Please sign in to comment.