| 1 |
context("string_repr") |
| 2 |
|
| 3 |
|
| 4 |
test_that("string_repr works as expected", { |
| 5 |
|
| 6 |
string_repr(mean) |
| 7 |
string_repr(function(x) print(x)) |
| 8 |
string_repr(iris) |
| 9 |
string_repr(iris, 16) |
| 10 |
string_repr(as.matrix(iris), 32) |
| 11 |
|
| 12 |
|
| 13 |
string_repr(data.table::as.data.table(iris), 36) |
| 14 |
string_repr(data.table::as.data.table(iris), 22) |
| 15 |
expect_equal(nchar(string_repr(data.table::as.data.table(iris), 22)), 22) |
| 16 |
expect_equal(nchar(string_repr(data.table::as.data.table(iris), 8)), 8) |
| 17 |
|
| 18 |
expect_equal(nchar(string_repr(as.matrix(iris), 8)), 8) |
| 19 |
|
| 20 |
expect_lte(nchar(string_repr(letters, 16)), 16) |
| 21 |
|
| 22 |
string_repr(letters, 16) |
| 23 |
string_repr(1:100, 16) |
| 24 |
|
| 25 |
|
| 26 |
expect_lte(nchar(string_repr(iris, 16)), 16) |
| 27 |
}) |