(t *testing.T)
| 55 | func (s *simpleSystem) Update(dt float32) {} |
| 56 | |
| 57 | func TestWorld_AddEntity(t *testing.T) { |
| 58 | |
| 59 | type args struct { |
| 60 | systems []SystemAddByInterfacer |
| 61 | e Identifier |
| 62 | } |
| 63 | tests := []struct { |
| 64 | name string |
| 65 | args args |
| 66 | }{ |
| 67 | {"works with multiple interfaces", args{ |
| 68 | systems: []SystemAddByInterfacer{&simpleSystem{}}, |
| 69 | e: &simpleEntity{NewBasic()}, |
| 70 | }, |
| 71 | }, |
| 72 | } |
| 73 | for _, tt := range tests { |
| 74 | t.Run(tt.name, func(t *testing.T) { |
| 75 | w := new(World) |
| 76 | sys := new(simpleSystem) |
| 77 | var face *BasicFace |
| 78 | w.AddSystemInterface(sys, []interface{}{face}, nil) |
| 79 | w.AddEntity(tt.args.e) |
| 80 | if len(sys.entities) == 0 { |
| 81 | t.Error(len(sys.entities)) |
| 82 | } |
| 83 | }) |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | type priorityChangeSystem struct { |
| 88 | Rank int |
nothing calls this directly
no test coverage detected
searching dependent graphs…