Skip to content

Commit

Permalink
fix test for non-UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Nov 2, 2017
1 parent 965277b commit 0ce2b5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions R/strrep.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if (getRversion() < "3.3.0") {
strrep <- function(x, times) {
map_chr(
times,
function(n) paste(rep(x, n), collapse = "")
)
}
}
7 changes: 5 additions & 2 deletions tests/testthat/test-rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ test_that("get_line_char", {
test_that("print.rule", {
mockery::stub(rule, "console_width", 20)
r <- rule("foo")
expect_output(print(r), rebox("── foo ─────────────"),
fixed = TRUE)
expect_output(
print(r),
paste(strrep(symbol$line, 2), "foo", strrep(symbol$line, 13)),
fixed = TRUE
)
})

0 comments on commit 0ce2b5a

Please sign in to comment.