Skip to content

Commit

Permalink
removing line_break parameter comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikeya committed Sep 29, 2023
1 parent 226ef9e commit 60972d3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,16 @@ testthat::test_that("padding_lst applies padding to a flextable based on indenta
testthat::expect_is(padded_ft, "flextable")
})

line_break <- 5
block_text <- paste(paste(rep("Line", line_break), seq_len(line_break)), collapse = "\n")
block_text <- paste(paste(rep("Line", 5), seq_len(5)), collapse = "\n")

testthat::test_that("split_text_block - n < line_break : splits text block into blocks no longer than n lines", {
testthat::test_that("split_text_block - splits text block into blocks no longer than n lines", {
n <- 2
result <- split_text_block(block_text, n)
result_lines <- lapply(result, function(x) strsplit(x, "\n")[[1]])
lapply(result_lines, function(x) testthat::expect_lte(length(x), n))
})

test_that("split_text_block - n >= line_break: returns single block with original text", {
test_that("split_text_block - returns single block with original text", {
n <- 7
result <- split_text_block(block_text, n)
testthat::expect_equal(result, list(block_text))
Expand Down

0 comments on commit 60972d3

Please sign in to comment.