Skip to content

Commit

Permalink
added all.equal.Object() that uses ==
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Sep 27, 2019
1 parent c5549de commit 66c51fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions r/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ S3method("[",RecordBatch)
S3method("[",Table)
S3method("[[",RecordBatch)
S3method("[[",Table)
S3method(all,equal.Object)
S3method(as.data.frame,RecordBatch)
S3method(as.data.frame,Table)
S3method(as.raw,Buffer)
Expand Down
5 changes: 5 additions & 0 deletions r/R/arrow-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ Object <- R6Class("Object",
#' @export
`!=.Object` <- function(lhs, rhs) !(lhs == rhs)

#' @export
all.equal.Object <- function(target, current, ...) {
target == current
}

shared_ptr <- function(class, xp) {
if (!shared_ptr_is_null(xp)) class$new(xp)
}
Expand Down
3 changes: 3 additions & 0 deletions r/tests/testthat/test-Table.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,8 @@ test_that("==.Table", {

expect_false(tab1 == tab4)
expect_false(tab4 == tab1)

expect_true(all.equal(tab1, tab2))
expect_equal(tab1, tab2)
})

0 comments on commit 66c51fd

Please sign in to comment.