Skip to content

Commit 1c523e3

Browse files
committed
- Adapt to dev prettyunits.
1 parent e76fa70 commit 1c523e3

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

DESCRIPTION

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ URL: https://github.com/tidyverse/blob
2121
BugReports: https://github.com/tidyverse/blob/issues
2222
Imports:
2323
methods,
24-
prettyunits,
24+
prettyunits (>= 1.1.0.9000),
2525
rlang,
2626
vctrs (>= 0.2.1)
2727
Suggests:
2828
covr,
2929
crayon,
3030
pillar (>= 1.2.1),
3131
testthat
32+
Remotes:
33+
r-lib/prettyunits#24
3234
Encoding: UTF-8
3335
LazyData: true
3436
Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd", "pkgapi::api_roclet"))

R/format.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ is_vector_s3.blob <- function(x) TRUE
3232

3333
blob_size <- function(x, digits = 3, trim = TRUE, ...) {
3434
x <- vapply(x, length, numeric(1))
35-
prettyunits::pretty_bytes(x)
35+
prettyunits::pretty_bytes(x, if (isTRUE(trim)) "nopad" else "default")
3636
}
3737

3838
# Dynamically exported, see zzz.R

tests/testthat/blob.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<blob[3]>
2-
[1] blob[4.00 B] blob[2.05 kB] blob[1.05 MB]
2+
[1] blob[4 B] blob[2.05 kB] blob[1.05 MB]

tests/testthat/test-format.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test_that("unequal sizes", {
1515
expect_format_equal(
1616
format(x),
1717
c(
18-
"blob[4.00 B]",
18+
"blob[4 B]",
1919
"blob[2.05 kB]",
2020
"blob[1.05 MB]"
2121
)
@@ -24,7 +24,7 @@ test_that("unequal sizes", {
2424
expect_format_equal(
2525
format(x, trim = FALSE),
2626
c(
27-
"blob[4.00 B]",
27+
"blob[ 4 B]",
2828
"blob[2.05 kB]",
2929
"blob[1.05 MB]"
3030
)

0 commit comments

Comments
 (0)