Skip to content

Commit 12ec881

Browse files
committed
Add tests
1 parent 8094dc1 commit 12ec881

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ HerbSearch = "3008d8e8-f9aa-438a-92ed-26e9c7b4829f"
1313
MetaGraphsNext = "fa8bd995-216d-47f1-8a91-f3b68fbeb377"
1414
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1515
SoleLogics = "b002da8f-3cb3-4d91-bbe3-2953433912b5"
16+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1617

1718
[compat]
1819
DynamicalSystems = "3"
1920
FileIO = "1"
2021
MetaGraphsNext = "0.7"
2122
SoleLogics = "0.9, 0.10"
23+
Statistics = "1.11.1"
2224
julia = "1.6"

src/qualitative_networks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const default_qn_constants = [2]
2323

2424
function build_qn_grammar(
2525
entity_names::AbstractVector{Symbol},
26-
constants::AbstractVector{Int},
26+
constants::AbstractVector{<:Integer},
2727
)
2828
g = deepcopy(base_qn_grammar)
2929

test/test-qn.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ using Graphs: ne, nv
77

88
@test issubset(Set(entities), Set(g.rules))
99
@test issubset(Set(constants), Set(g.rules))
10+
11+
g2 = QualitativeNetworks.build_qn_grammar(Symbol[], Integer[])
12+
13+
@test isempty(setdiff(Set(g2.rules), Set(entities)))
14+
@test isempty(setdiff(Set(g2.rules), Set(constants)))
1015
end
1116

1217
@testset "QN Sampling" begin

0 commit comments

Comments
 (0)