Skip to content

Commit

Permalink
Add missing Random import (#211)
Browse files Browse the repository at this point in the history
* Add missing `Random` import

* debug
  • Loading branch information
MichaelHatherly authored Nov 25, 2024
1 parent 407921d commit 6c3920e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ import InteractiveUtils
import Logging
import Pkg
import REPL
import Random

# Includes.

Expand Down
17 changes: 17 additions & 0 deletions test/examples/integrations/RCallSVG.qmd
Original file line number Diff line number Diff line change
@@ -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)"
```
12 changes: 12 additions & 0 deletions test/testsets/integrations/RCall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6c3920e

Please sign in to comment.