Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/19657#discussion_r149448556
--- Diff: R/pkg/tests/fulltests/test_utils.R ---
@@ -236,4 +236,23 @@ test_that("basenameSansExtFromUrl", {
expect_equal(basenameSansExtFromUrl(z), "spark-2.1.0--hive")
})
+test_that("getOne", {
+ dummy <- getOne(".dummyValue", envir = new.env(), ifnotfound = FALSE)
+ expect_equal(dummy, FALSE)
+})
+
+test_that("traverseParentDirs", {
+ if (is_windows()) {
+ dirs <-
traverseParentDirs("c:\\Users\\user\\AppData\\Local\\Apache\\Spark\\Cache\\spark2.2",
3)
+ expect <-
c("c:\\Users\\user\\AppData\\Local\\Apache\\Spark\\Cache\\spark2.2",
+ "c:\\Users\\user\\AppData\\Local\\Apache\\Spark\\Cache",
+ "c:\\Users\\user\\AppData\\Local\\Apache\\Spark",
+ "c:\\Users\\user\\AppData\\Local\\Apache")
+ } else {
+ dirs <-
traverseParentDirs("/Users/user/Library/Caches/spark/spark2.2", 1)
--- End diff --
sure, but well hopefully the implementation is not platform dependent,
otherwise we will need to test linux as well as osx
(and it doesn't check if the path is valid/present)
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]