Skip to content

Commit ff1d71c

Browse files
committed
implement c()
- Calling `c()` on blob objects returns a blob.
1 parent 3b5f6cf commit ff1d71c

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ S3method(as.blob,integer)
1010
S3method(as.blob,list)
1111
S3method(as.blob,raw)
1212
S3method(as.data.frame,blob)
13+
S3method(c,blob)
1314
S3method(format,blob)
1415
S3method(is.na,blob)
1516
S3method(is_vector_s3,blob)

R/accessors.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@
2525
NextMethod()
2626
}
2727
}
28+
29+
#' @export
30+
c.blob <- function(x, ...) as.blob(NextMethod())

tests/testthat/test-accessors.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,10 @@ test_that("can insert raw or NULL", {
2222

2323
expect_equal(x, blob(as.raw(0), as.raw(0), NULL, NULL))
2424
})
25+
26+
test_that("can combine", {
27+
expect_identical(
28+
c(blob(raw(4), raw(5)), blob(raw(7))),
29+
blob(raw(4), raw(5), raw(7))
30+
)
31+
})

0 commit comments

Comments
 (0)