Skip to content

Commit 4b22d72

Browse files
committed
add tests
1 parent 495ab9a commit 4b22d72

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ DomainSets = "0.7.6"
2626
FillArrays = "1"
2727
LazyArrays = "1.2, 2"
2828
RecipesBase = "1.0"
29+
Plots = "1"
2930
StaticArrays = "1"
3031
julia = "1.6"
3132

3233
[extras]
3334
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
3435
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
36+
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
3537
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3638
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
3739
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3840

3941
[targets]
40-
test = ["Base64", "IntervalSets", "Random", "SparseArrays", "Test"]
42+
test = ["Base64", "IntervalSets", "Plots", "Random", "SparseArrays", "Test"]

test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using QuasiArrays, Test
2+
include("test_plots.jl")
23

34
include("test_abstractquasiarray.jl")
45
include("test_quasibroadcast.jl")
@@ -21,4 +22,4 @@ include("test_quasikron.jl")
2122
include("test_ldiv.jl")
2223
include("test_quasilazy.jl")
2324

24-
include("test_sparsequasi.jl")
25+
include("test_sparsequasi.jl")

test/test_plots.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Plots
2+
3+
function struct_isequal(a,b)
4+
fa = fieldnames(typeof(a))
5+
fb = fieldnames(typeof(b))
6+
fa != fb && return false
7+
for f in fa
8+
!struct_isequal(getfield(a,f),getfield(b,f)) && return false
9+
end
10+
return true
11+
end
12+
13+
@testset "plots" begin
14+
v = QuasiVector(rand(5), rand(5))
15+
a = plot(v)
16+
b = plot(axes(v,1),parent(v))
17+
@test struct_isequal(a,b)
18+
end

0 commit comments

Comments
 (0)