Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsas committed Aug 16, 2024
1 parent c501104 commit ccd296e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions test/dsl/dsl_advanced_model_construction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ let
@test isequal(Catalyst.getmetadata_dict(r3), Catalyst.getmetadata_dict(rxs[3]))

# Checks that accessor functions works on the DSL.
@test getmetadata(rxs[1], :noise_scaling)
@test !getmetadata(rxs[1], :md_1)
@test !getmetadata(rxs[2], :noise_scaling)
@test getmetadata(rxs[2], :md_1)
@test !getmetadata(rxs[3], :noise_scaling)
@test !getmetadata(rxs[3], :md_1)
@test hasmetadata(rxs[1], :noise_scaling)
@test !hasmetadata(rxs[1], :md_1)
@test !hasmetadata(rxs[2], :noise_scaling)
@test hasmetadata(rxs[2], :md_1)
@test !hasmetadata(rxs[3], :noise_scaling)
@test !hasmetadata(rxs[3], :md_1)

@test isequal(getmetadata(rxs[1], :noise_scaling), η)
@test isequal(getmetadata(rxs[2], :md_1), 1.0)
Expand Down
20 changes: 10 additions & 10 deletions test/reactionsystem_core/reaction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ let
r = Reaction(k, [X], [X2], [2], [1]; metadata=metadata)

@test Catalyst.getmetadata_dict(r) == [:noise_scaling => 0.0]
@test getmetadata(r, :noise_scaling)
@test !getmetadata(r, :nonexisting_metadata)
@test hasmetadata(r, :noise_scaling)
@test !hasmetadata(r, :nonexisting_metadata)
@test getmetadata(r, :noise_scaling) == 0.0
@test_throws Exception getmetadata(r, :misc)
setmetadata(r, :test_metadata, 1234)
Expand All @@ -157,7 +157,7 @@ let

@test isequal(r1, r2)
@test Catalyst.getmetadata_dict(r1) == Pair{Symbol,Any}[]
@test !getmetadata(r1, :md)
@test !hasmetadata(r1, :md)
end

# Tests creation.
Expand All @@ -177,13 +177,13 @@ let
r = Reaction(k, [X], [X2], [2], [1]; metadata=metadata)

@test Catalyst.getmetadata_dict(r) isa Vector{Pair{Symbol,Any}}
@test getmetadata(r, :md_1)
@test getmetadata(r, :md_2)
@test getmetadata(r, :md_3)
@test getmetadata(r, :md_4)
@test getmetadata(r, :md_5)
@test getmetadata(r, :md_6)
@test !getmetadata(r, :md_8)
@test hasmetadata(r, :md_1)
@test hasmetadata(r, :md_2)
@test hasmetadata(r, :md_3)
@test hasmetadata(r, :md_4)
@test hasmetadata(r, :md_5)
@test hasmetadata(r, :md_6)
@test !hasmetadata(r, :md_8)

@test isequal(getmetadata(r, :md_1), 1.0)
@test isequal(getmetadata(r, :md_2), false)
Expand Down

0 comments on commit ccd296e

Please sign in to comment.