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

Function TestTMXTileImageWrongFileType

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

Source from the content-addressed store, hash-verified

405}
406
407func TestTMXTileImageWrongFileType(t *testing.T) {
408 buf := bytes.NewBuffer([]byte{})
409 tmpl, err := template.New("test").Parse(testTMXtmpl)
410 if err != nil {
411 t.Error("Error parsing tmx template")
412 }
413 err = tmpl.Execute(buf, tmxData{
414 Orientation: "orthogonal",
415 RenderOrder: "right-down",
416 Tiles: true,
417 BadExtensions: ".test",
418 })
419 if err != nil {
420 t.Error("Error executing tmx template")
421 }
422
423 err = engo.Files.LoadReaderData("test.tmx", buf)
424 if err == nil {
425 t.Error("Able to load tmx when it contains bad image files")
426 }
427}
428
429func TestTMXBadImageExtension(t *testing.T) {
430 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