Skip to content

Commit

Permalink
Update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
renkun-ken committed Aug 11, 2021
1 parent 9eca144 commit 695a0c6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/testthat/test-hover.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ test_that("Hover on user function with multi-lined arguments works", {
") {",
" x + y",
"}",
"test1"
"test1",
"test2 = function(",
" x, # arg 1",
" y # arg 2",
") {",
" x + y",
"}",
"test2"
),
temp_file
)
Expand All @@ -76,6 +83,11 @@ test_that("Hover on user function with multi-lined arguments works", {
expect_length(result$contents, 1)
expect_equal(result$contents[1], "```r\ntest1(x, y)\n```")
expect_equal(result$range$end$character, 5)

result <- client %>% respond_hover(temp_file, c(13, 3))
expect_length(result$contents, 1)
expect_equal(result$contents[1], "```r\ntest2(x, y)\n```")
expect_equal(result$range$end$character, 5)
})

test_that("Hover on variable works", {
Expand Down

0 comments on commit 695a0c6

Please sign in to comment.