Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 29, 2023
1 parent 49c1277 commit 90f946c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/testthat/test-export_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test_that("export_table", {
),
format = "pipe",
class = c("knitr_kable", "character")
))
), ignore_attr = TRUE)
})

d <- data.frame(a = c(1.3, 2, 543), b = c("ab", "cd", "abcde"), stringsAsFactors = FALSE)
Expand All @@ -38,7 +38,8 @@ test_that("export_table", {
),
format = "pipe",
class = c("knitr_kable", "character")
)
),
ignore_attr = TRUE
)
})

Expand All @@ -56,7 +57,8 @@ test_that("export_table", {
),
format = "pipe",
class = c("knitr_kable", "character")
)
),
ignore_attr = TRUE
)
})

Expand All @@ -73,7 +75,8 @@ test_that("export_table", {
),
format = "pipe",
class = c("knitr_kable", "character")
)
),
ignore_attr = TRUE
)
})

Expand All @@ -93,6 +96,7 @@ test_that("export_table", {
),
format = "pipe",
class = c("knitr_kable", "character")
)
),
ignore_attr = TRUE
)
})
7 changes: 7 additions & 0 deletions tests/testthat/test-utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,10 @@ test_that("safe_deparse_symbol() works", {
expect_identical(safe_deparse(as.name("test")), "test")
expect_identical(safe_deparse("test"), "\"test\"")
})

test_that("trim_ws() works with non-ascii chars", {
expect_identical(
trim_ws(c("test ", " Se\x96ora ", "works \x97fine ", "this too", "yeah")),
c("test", "Se\x96ora", "works \x97fine", "this too", "yeah")
)
})

0 comments on commit 90f946c

Please sign in to comment.