Skip to content

Commit

Permalink
Remove ) causing parse error in example_zoo.jl (#938)
Browse files Browse the repository at this point in the history
* Compare against nothing with === in src and test

* Remove ) causing parseerror
  • Loading branch information
jacobusmmsmit authored Nov 20, 2023
1 parent 37d3a13 commit 3526b5c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/logo/example_zoo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ function fractal_step!(model)
while model.spawn_count > 0
p_r = particle_radius(model.min_radius, model.max_radius, abmrng(model))
pos = (rand_circle(abmrng(model)) .+ 1.0) .* abmspace(model).extent .* 0.49
prop_particle = PropFractalParticle(p_r, rand(abmrng(model)) < model.clockwise_fraction))
prop_particle = PropFractalParticle(p_r, rand(abmrng(model)) < model.clockwise_fraction)
add_agent!(pos, FractalParticle, model, prop_particle...)
model.spawn_count -= 1
end
Expand Down
2 changes: 1 addition & 1 deletion src/core/agents.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ macro agent(struct_repr)
if !@capture(struct_repr, struct new_type_(base_type_spec_) <: abstract_type_ new_fields__ end)
@capture(struct_repr, struct new_type_(base_type_spec_) new_fields__ end)
end
abstract_type == nothing && (abstract_type = :(Agents.AbstractAgent))
abstract_type === nothing && (abstract_type = :(Agents.AbstractAgent))
base_agent = __AGENT_GENERATOR__[namify(base_type_spec)]
@capture(base_agent, mutable struct base_type_general_ <: _ __ end)
old_args = base_type_general isa Symbol ? [] : base_type_general.args[2:end]
Expand Down
4 changes: 2 additions & 2 deletions test/visualization_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@testset "agent visualizations" begin
include("../examples/agents_visualizations.jl")
# testing no error when removing files
@test rm("daisyworld.mp4") == nothing
@test rm("daisyworld.mp4") === nothing
include("../examples/zombies.jl")
@test rm("outbreak.mp4") == nothing
@test rm("outbreak.mp4") === nothing
end

0 comments on commit 3526b5c

Please sign in to comment.