MCPcopy Create free account
hub / github.com/EngoEngine/ecs / TestChangeableComponents

Function TestChangeableComponents

entity_test.go:199–213  ·  view source on GitHub ↗

TestChangeableComponents ensures that Components which are being referenced, are changeable

(t *testing.T)

Source from the content-addressed store, hash-verified

197
198// TestChangeableComponents ensures that Components which are being referenced, are changeable
199func TestChangeableComponents(t *testing.T) {
200 w := &World{}
201
202 sys1 := &MySystemOne{}
203 w.AddSystem(sys1)
204
205 e1 := MyEntity1{}
206 e1.BasicEntity = NewBasic()
207
208 sys1.Add(&e1.BasicEntity, &e1.MyComponent1)
209
210 sys1.Update(0.125)
211
212 assert.NotZero(t, e1.MyComponent1.A, "MySystemOne should have been able to change the value of MyComponent1.A")
213}
214
215// TestDelete tests a commonly used method for removing an entity from the list of entities
216func TestDelete(t *testing.T) {

Callers

nothing calls this directly

Calls 4

AddSystemMethod · 0.95
AddMethod · 0.95
UpdateMethod · 0.95
NewBasicFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…