Skip to content

Commit 7ce8882

Browse files
committed
update formatting
@hadley: Is this the formatting we want to see? Changing this requires patching prettyunits or using our own code again.
1 parent bef080c commit 7ce8882

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

tests/testthat/test-format.R

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,40 @@ expect_format_equal <- function(formatted, result) {
88
}
99

1010
test_that("unequal sizes", {
11+
skip_on_cran()
12+
1113
x <- blob(raw(2 ** 2), raw(2 ** 11), raw(2 ** 20))
1214

1315
expect_format_equal(
1416
format(x),
1517
c(
16-
"blob[4 B]",
17-
"blob[2,050 B]",
18-
"blob[1,050,000 B]"
18+
"blob[4.00 B]",
19+
"blob[2.05 kB]",
20+
"blob[1.05 MB]"
1921
)
2022
)
2123

2224
expect_format_equal(
2325
format(x, trim = FALSE),
2426
c(
25-
"blob[ 4 B]",
26-
"blob[ 2,050 B]",
27-
"blob[1,050,000 B]"
27+
"blob[4.00 B]",
28+
"blob[2.05 kB]",
29+
"blob[1.05 MB]"
2830
)
2931
)
3032
})
3133

3234
test_that("similar sizes", {
35+
skip_on_cran()
36+
3337
x <- blob(raw(2 ** 10), raw(2 ** 11), raw(2 ** 12))
3438

3539
expect_format_equal(
3640
format(x),
3741
c(
38-
"blob[1 kB]",
39-
"blob[2 kB]",
40-
"blob[4 kB]"
42+
"blob[1.02 kB]",
43+
"blob[2.05 kB]",
44+
"blob[4.10 kB]"
4145
)
4246
)
4347
})

0 commit comments

Comments
 (0)