From 0f2dae0292d5e48e668b065c4fbe52e7b8b272fc Mon Sep 17 00:00:00 2001 From: Filip Krikava Date: Sat, 14 Sep 2024 20:32:15 +0000 Subject: [PATCH] Fix test --- client/rsh/R/rsh.R | 4 ++++ client/rsh/tests/test-remote-compilation.R | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/client/rsh/R/rsh.R b/client/rsh/R/rsh.R index 2cfef900..2597ac36 100644 --- a/client/rsh/R/rsh.R +++ b/client/rsh/R/rsh.R @@ -67,6 +67,10 @@ rsh_compile <- function(f, options) { options$name <- as.character(substitute(f)) } + if (is.null(options$inplace)) { + options$inplace <- TRUE + } + invisible(.Call(C_compile, f, options)) } diff --git a/client/rsh/tests/test-remote-compilation.R b/client/rsh/tests/test-remote-compilation.R index 22106662..1f54d9ad 100644 --- a/client/rsh/tests/test-remote-compilation.R +++ b/client/rsh/tests/test-remote-compilation.R @@ -1,7 +1,7 @@ -# f <- function() { -# 42 -# } -# -# rsh::rsh_compile(f) -# stopifnot(rsh::is_compiled(f)) -# stopifnot(f() == 42) +f <- function() { + 42 +} + +rsh::rsh_compile(f) +stopifnot(rsh::is_compiled(f)) +stopifnot(f() == 42)