(t *testing.T)
| 187 | } |
| 188 | |
| 189 | func TestAnimationComponentNextFrameNoData(t *testing.T) { |
| 190 | var buf bytes.Buffer |
| 191 | log.SetOutput(&buf) |
| 192 | drawables := []Drawable{ |
| 193 | &TestDrawable{0}, |
| 194 | &TestDrawable{1}, |
| 195 | &TestDrawable{2}, |
| 196 | } |
| 197 | ac := NewAnimationComponent(drawables, 0.1) |
| 198 | action := &Animation{ |
| 199 | Name: "action", |
| 200 | Frames: []int{}, |
| 201 | } |
| 202 | ac.AddAnimation(action) |
| 203 | ac.SelectAnimationByAction(action) |
| 204 | ac.NextFrame() |
| 205 | |
| 206 | if strings.HasSuffix(buf.String(), "No data for this animation") { |
| 207 | t.Errorf("Wrong message recieved when NextFrame was called with no data. Got: %v", buf.String()) |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | type TestAnimationEntity struct { |
| 212 | *ecs.BasicEntity |
nothing calls this directly
no test coverage detected