forked from MakieOrg/Makie.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline.jl
36 lines (31 loc) · 900 Bytes
/
pipeline.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# extracted from interfaces.jl
function test_copy(; kw...)
scene = Scene()
return Makie.merged_get!(
()-> Makie.default_theme(scene, Lines),
:lines, scene, Attributes(kw)
)
end
function test_copy2(attr; kw...)
return merge!(Attributes(kw), attr)
end
@testset "don't copy in theme merge" begin
x = Observable{Any}(1)
res=test_copy(linewidth=x)
res.linewidth === x
end
@testset "don't copy observables in when calling merge!" begin
x = Observable{Any}(1)
res=test_copy2(Attributes(linewidth=x))
res.linewidth === x
end
@testset "don't copy attributes in recipe" begin
fig = Figure()
ax = Axis(fig[1, 1])
list = Observable{Any}([1, 2, 3, 4])
xmax = Observable{Any}([0.25, 0.5, 0.75, 1])
p = hlines!(ax, list, xmax = xmax, color = :blue)
@test getfield(p, :input_args)[1] === list
@test p.xmax === xmax
fig
end