Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
🔧 add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoisot committed Jul 8, 2019
1 parent 62337a9 commit fa12d6f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using Pkg

tmp_packages = ["EcologicalNetworksPlots", "Plots"]

push!(LOAD_PATH,"../src/")

Pkg.activate(".")

Pkg.add("EcologicalNetworksPlots") # IMPORTANT
Pkg.add("Plots") # IMPORTANT
Pkg.add.(tmp_packages) # IMPORTANT

using Documenter
using EcologicalNetworks
Expand All @@ -31,7 +32,7 @@ makedocs(
"Overlap and similarity" => "properties/overlap.md",
"Null models" => "properties/nullmodels.md",
"Beta-diversity" => "properties/betadiversity.md",
"Resilience" => "properties/resilience.md"
"Resilience" => "properties/resilience.md",
"Information theory" => "properties/information.md"
],
"Plots" => "plots.md"
Expand All @@ -44,5 +45,4 @@ deploydocs(
devbranch = "master"
)

Pkg.rm("EcologicalNetworksPlots") # IMPORTANT
Pkg.rm("Plots") # IMPORTANT
Pkg.rm.(tmp_packages) # IMPORTANT
4 changes: 4 additions & 0 deletions docs/src/plots.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Plotting functions are part of the `EcologicalNetworksPlot`, which requires
`Plot` to work.


## Initial layouts

```@docs
Expand Down
3 changes: 3 additions & 0 deletions test/rand/cascademodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ module TestCascadeModel
@test richness(cascademodel(10, 0.1)) == 10
@test richness(cascademodel(10, 0.2)) == 10
@test richness(cascademodel(20, 0.1)) == 20

@test richness(cascademodel((10, 0.1))) == 10
@test richness(cascademodel((10, 10))) == 10

@test_throws ArgumentError cascademodel(10, 0.9)
@test_throws ArgumentError cascademodel(10, 0.7)
Expand Down
5 changes: 5 additions & 0 deletions test/types/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ M = convert(UnipartiteNetwork, N)
@test has_interaction(M, :b, :B)
@test !has_interaction(M, :A, :B)

# Convert back to bipartite
K = convert(BipartiteNetwork, M)
@test has_interaction(M, :b, :B)
@test !has_interaction(M, :A, :B)

N = BipartiteQuantitativeNetwork([4 0 ; 2 1], [:a, :b], [:A, :B])
M = convert(UnipartiteQuantitativeNetwork, N)
@test has_interaction(M, :a, :A)
Expand Down

0 comments on commit fa12d6f

Please sign in to comment.