MCPcopy
hub / github.com/EngoEngine/engo / TestTMXTileImagesNotLoadedFileNotExist

Function TestTMXTileImagesNotLoadedFileNotExist

common/tmx_test.go:343–363  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

341}
342
343func TestTMXTileImagesNotLoadedFileNotExist(t *testing.T) {
344 buf := bytes.NewBuffer([]byte{})
345 tmpl, err := template.New("test").Parse(testTMXtmpl)
346 if err != nil {
347 t.Error("Error parsing tmx template")
348 }
349 err = tmpl.Execute(buf, tmxData{
350 Orientation: "orthogonal",
351 RenderOrder: "right-down",
352 Tiles: true,
353 })
354 if err != nil {
355 t.Error("Error executing tmx template")
356 }
357
358 engo.Files.Unload("test.png")
359 err = engo.Files.LoadReaderData("test.tmx", buf)
360 if err == nil {
361 t.Errorf("Able to load tmx file even though assets aren't found.")
362 }
363}
364
365func TestTMXTileImagesNotLoadedTempFile(t *testing.T) {
366 imgbuf := bytes.NewBuffer([]byte{})

Callers

nothing calls this directly

Calls 4

LoadReaderDataMethod · 0.80
UnloadMethod · 0.65
NewMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected