diff --git a/src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl b/src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl index ad095b7..44948f4 100644 --- a/src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl +++ b/src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl @@ -86,6 +86,7 @@ import InteractiveUtils import Logging import Pkg import REPL +import Random # Includes. diff --git a/test/examples/integrations/RCallSVG.qmd b/test/examples/integrations/RCallSVG.qmd new file mode 100644 index 0000000..12d062f --- /dev/null +++ b/test/examples/integrations/RCallSVG.qmd @@ -0,0 +1,17 @@ +--- +title: RCall integration +fig-width: 4 +fig-height: 3 +fig-dpi: 150 +fig-format: svg +julia: + exeflags: ["--project=RCall"] +--- + +```{julia} +using RCall +``` + +```{julia} +R"plot(1:10)" +``` diff --git a/test/testsets/integrations/RCall.jl b/test/testsets/integrations/RCall.jl index eeddffb..35bf169 100644 --- a/test/testsets/integrations/RCall.jl +++ b/test/testsets/integrations/RCall.jl @@ -10,3 +10,15 @@ test_example(joinpath(@__DIR__, "../../examples/integrations/RCall.qmd")) do jso @test cell["outputs"][1]["metadata"]["image/png"] == Dict("width" => 600, "height" => 450) end + +# Don't run this on macOS CI, since that appears to be missing the required libs. +if !(get(ENV, "CI", "false") == "true" && Sys.isapple()) + test_example(joinpath(@__DIR__, "../../examples/integrations/RCallSVG.qmd")) do json + cells = json["cells"] + cell = cells[4] + output = cell["outputs"][1] + + @test !isempty(output["data"]["image/svg+xml"]) + @test isempty(cell["outputs"][1]["metadata"]) + end +end