@@ -10,7 +10,10 @@ test_that("._java_version_check_rjava_impl_original prefers callr", {
1010 captured_libpath <<- libpath
1111 list (
1212 java_version = " 21.0.8" ,
13- output = " rJava and other rJava/Java-based packages will use Java version: \" 21.0.8\" "
13+ output = paste0(
14+ " rJava and other rJava/Java-based packages will use " ,
15+ " Java version: \" 21.0.8\" "
16+ )
1417 )
1518 },
1619 .package = " callr"
@@ -62,7 +65,9 @@ test_that("._java_version_check_rjava_impl_original falls back to Rscript", {
6265 if (file.exists(args [1 ])) {
6366 captured_script <<- readLines(args [1 ])
6467 }
65- " rJava and other rJava/Java-based packages will use Java version: \" 21.0.8\" "
68+ c(
69+ " rJava and other rJava/Java-based packages will use Java version: \" 21\" "
70+ )
6671 },
6772 .package = " base"
6873 )
@@ -73,10 +78,10 @@ test_that("._java_version_check_rjava_impl_original falls back to Rscript", {
7378
7479 expect_equal(result $ major_version , " 21" )
7580 expect_equal(captured_env [[" JAVA_HOME" ]], " /mock/java" )
76- expect_false(any(grepl(" get_libjvm_path <- function" , captured_script )))
7781 expect_equal(sum(grepl(" java_version_check <- function" , captured_script )), 1 )
7882
7983 script_text <- paste(captured_script , collapse = " \n " )
8084 expect_true(grepl(" \\ .libPaths\\ (c\\ (" , script_text ))
8185 expect_true(grepl(" /home/user/R/x86_64-pc-linux-gnu-library/4.5" , script_text ))
86+ expect_false(any(grepl(" get_libjvm_path <- function" , captured_script )))
8287})
0 commit comments