Skip to content

Commit 2565f00

Browse files
authored
Merge pull request #394 from renkun-ken/testthat-3
2 parents 62b06e5 + 8325b10 commit 2565f00

22 files changed

Lines changed: 7 additions & 43 deletions

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ LazyData: true
5252
NeedsCompilation: yes
5353
Roxygen: list(markdown = TRUE, r6 = FALSE)
5454
RoxygenNote: 7.1.1
55+
Config/testthat/edition: 3

tests/testthat/helper-utils.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ suppressPackageStartupMessages({
88
# a hack to make withr::defer_parent to work, see https://github.com/r-lib/withr/issues/123
99
defer <- withr::defer
1010

11+
expect_equivalent <- function(x, y) {
12+
expect_equal(x, y, ignore_attr = TRUE)
13+
}
14+
1115
language_client <- function(working_dir = getwd(), diagnostics = FALSE, capabilities = NULL) {
1216

1317
if (nzchar(Sys.getenv("R_LANGSVR_LOG"))) {

tests/testthat/test-call-hierarchy.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
context("Test call hierarchy")
2-
31
test_that("Call hierarchy works in single file", {
42
skip_on_cran()
53
client <- language_client()
@@ -196,7 +194,6 @@ test_that("Call hierarchy outgoing calls works", {
196194
expect_length(result, 2)
197195

198196
result1 <- result %>% keep(~ .$to$name == "foo")
199-
print(result1)
200197

201198
expect_equal(result1[[1]]$to$name, "foo")
202199
expect_equal(result1[[1]]$to$kind, SymbolKind$Function)

tests/testthat/test-codeunits.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
context("Test Multi Bytes Characters")
2-
31
test_that("Code units are correctly calculated", {
42
skip_on_os("solaris")
53
expect_equal(ncodeunit("a"), 1)

tests/testthat/test-color.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
context("Test Color")
2-
31
get_color <- function(color) {
42
rgba <- grDevices::col2rgb(color, alpha = TRUE) / 255
53
as.list(rgba[, 1])

tests/testthat/test-completion.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
context("Test Completion")
2-
31
test_that("Simple completion works", {
42
skip_on_cran()
53
client <- language_client()

tests/testthat/test-definition.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
context("Test Definition")
2-
31
test_that("Go to Definition works for functions in files", {
42
skip_on_cran()
53
client <- language_client()

tests/testthat/test-folding.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
context("Test Folding Range")
2-
31
test_that("Expression folding rage works", {
42
skip_on_cran()
53
client <- language_client()
@@ -17,8 +15,8 @@ test_that("Expression folding rage works", {
1715
result <- result[order(sapply(result, "[[", "startLine"))]
1816

1917
expect_equal(length(result), 1)
20-
expect_equivalent(result[[1]]$startLine, 0)
21-
expect_equivalent(result[[1]]$endLine, 1)
18+
expect_equal(result[[1]]$startLine, 0)
19+
expect_equal(result[[1]]$endLine, 1)
2220
})
2321

2422
test_that("Section folding range works", {

tests/testthat/test-formatting.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
context("Test Formatting")
2-
31
test_that("Formatting document works", {
42
skip_on_cran()
53
client <- language_client()

tests/testthat/test-highlight.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
context("Test Highlight")
2-
31
test_that("Document highlight works", {
42
skip_on_cran()
53
client <- language_client()

0 commit comments

Comments
 (0)