MCPcopy Index your code
hub / github.com/EngoEngine/engo / TestTMXBadObjectImageExtension

Function TestTMXBadObjectImageExtension

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

Source from the content-addressed store, hash-verified

449}
450
451func TestTMXBadObjectImageExtension(t *testing.T) {
452 buf := bytes.NewBuffer([]byte{})
453 tmpl, err := template.New("test").Parse(testTMXtmpl)
454 if err != nil {
455 t.Error("Error parsing tmx template")
456 }
457 err = tmpl.Execute(buf, tmxData{
458 Orientation: "orthogonal",
459 RenderOrder: "left-down",
460 BadObjectImageExtension: ".test",
461 ChunkData: true,
462 })
463 if err != nil {
464 t.Error("Error executing tmx template")
465 }
466
467 engo.Files.Unload("test.png.test")
468 err = engo.Files.LoadReaderData("test.tmx", buf)
469 if err == nil {
470 t.Error("Able to load tmx with bad object image layer extension")
471 }
472}
473
474func TestObjectImageNotExistTempFile(t *testing.T) {
475 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