Skip to content

Commit

Permalink
forgot spec
Browse files Browse the repository at this point in the history
  • Loading branch information
konovod committed Aug 15, 2023
1 parent b926daa commit 6d70b91
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/myecs_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,20 @@ it "singleton correctly serialized" do
world2.getConfig.value.should eq 101
end

it "singleton correctly serialized when not present" do
world = ECS::World.new
io = IO::Memory.new
16.times { ent = world.new_entity.add(Pos.new(1, 1)) }
world.new_entity.add(Config.new(101))
world.new_entity.remove(Config)
world.encode io

world2 = ECS::World.new
io.rewind
world2.decode io
world2.getConfig?.should be_nil
end

class TestOrderSystem < ECS::System
getter list = [] of String

Expand Down

0 comments on commit 6d70b91

Please sign in to comment.