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

Function TestTMXBadImageExtension

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

Source from the content-addressed store, hash-verified

427}
428
429func TestTMXBadImageExtension(t *testing.T) {
430 buf := bytes.NewBuffer([]byte{})
431 tmpl, err := template.New("test").Parse(testTMXtmpl)
432 if err != nil {
433 t.Error("Error parsing tmx template")
434 }
435 err = tmpl.Execute(buf, tmxData{
436 Orientation: "orthogonal",
437 RenderOrder: "right-down",
438 Tiles: true,
439 BadImageExtension: ".test",
440 })
441 if err != nil {
442 t.Error("Error executing tmx template")
443 }
444
445 err = engo.Files.LoadReaderData("test.tmx", buf)
446 if err == nil {
447 t.Error("Able to load tmx with bad image layer extension")
448 }
449}
450
451func TestTMXBadObjectImageExtension(t *testing.T) {
452 buf := bytes.NewBuffer([]byte{})

Callers

nothing calls this directly

Calls 3

LoadReaderDataMethod · 0.80
NewMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected