diff options
author | felixcheung <felixcheung_m@hotmail.com> | 2016-01-19 18:31:03 -0800 |
---|---|---|
committer | Shivaram Venkataraman <shivaram@cs.berkeley.edu> | 2016-01-19 18:31:03 -0800 |
commit | 488bbb216c82306e82b8963a331d48d484e8eadd (patch) | |
tree | b8124d51a1806e68b8038b20481221b7fe1765ec /R/pkg/inst/tests/testthat/test_context.R | |
parent | beda9014220be77dd735e6af1903e7d93dceb110 (diff) | |
download | spark-488bbb216c82306e82b8963a331d48d484e8eadd.tar.gz spark-488bbb216c82306e82b8963a331d48d484e8eadd.tar.bz2 spark-488bbb216c82306e82b8963a331d48d484e8eadd.zip |
[SPARK-12232][SPARKR] New R API for read.table to avoid name conflict
shivaram sorry it took longer to fix some conflicts, this is the change to add an alias for `table`
Author: felixcheung <felixcheung_m@hotmail.com>
Closes #10406 from felixcheung/readtable.
Diffstat (limited to 'R/pkg/inst/tests/testthat/test_context.R')
-rw-r--r-- | R/pkg/inst/tests/testthat/test_context.R | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/R/pkg/inst/tests/testthat/test_context.R b/R/pkg/inst/tests/testthat/test_context.R index 92dbd575c2..3b14a497b4 100644 --- a/R/pkg/inst/tests/testthat/test_context.R +++ b/R/pkg/inst/tests/testthat/test_context.R @@ -24,11 +24,11 @@ test_that("Check masked functions", { func <- lapply(masked, function(x) { capture.output(showMethods(x))[[1]] }) funcSparkROrEmpty <- grepl("\\(package SparkR\\)$|^$", func) maskedBySparkR <- masked[funcSparkROrEmpty] - expect_equal(length(maskedBySparkR), 18) - expect_equal(sort(maskedBySparkR), sort(c("describe", "cov", "filter", "lag", "na.omit", - "predict", "sd", "var", "colnames", "colnames<-", - "intersect", "rank", "rbind", "sample", "subset", - "summary", "table", "transform"))) + namesOfMasked <- c("describe", "cov", "filter", "lag", "na.omit", "predict", "sd", "var", + "colnames", "colnames<-", "intersect", "rank", "rbind", "sample", "subset", + "summary", "transform") + expect_equal(length(maskedBySparkR), length(namesOfMasked)) + expect_equal(sort(maskedBySparkR), sort(namesOfMasked)) # above are those reported as masked when `library(SparkR)` # note that many of these methods are still callable without base:: or stats:: prefix # there should be a test for each of these, except followings, which are currently "broken" @@ -36,8 +36,9 @@ test_that("Check masked functions", { any(grepl("=\"ANY\"", capture.output(showMethods(x)[-1]))) })) maskedCompletely <- masked[!funcHasAny] - expect_equal(length(maskedCompletely), 4) - expect_equal(sort(maskedCompletely), sort(c("cov", "filter", "sample", "table"))) + namesOfMaskedCompletely <- c("cov", "filter", "sample") + expect_equal(length(maskedCompletely), length(namesOfMaskedCompletely)) + expect_equal(sort(maskedCompletely), sort(namesOfMaskedCompletely)) }) test_that("repeatedly starting and stopping SparkR", { |