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

Function TestTMXTileNotLoadedFileNotExist

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

Source from the content-addressed store, hash-verified

153}
154
155func TestTMXTileNotLoadedFileNotExist(t *testing.T) {
156 // Ensure the file is not loaded
157 engo.Files.Unload("test.png")
158
159 // Load the template
160 buf := bytes.NewBuffer([]byte{})
161 tmpl, err := template.New("test").Parse(testTMXtmpl)
162 if err != nil {
163 t.Error("Error parsing tmx template")
164 }
165 err = tmpl.Execute(buf, tmxData{
166 Orientation: "orthogonal",
167 RenderOrder: "right-up",
168 ChunkData: true,
169 })
170 if err != nil {
171 t.Error("Error executing tmx template")
172 }
173
174 // Load tmx
175 err = engo.Files.LoadReaderData("test.tmx", buf)
176 if err == nil {
177 t.Errorf("Unable to load tmx file from unloaded png. Error was: %v", err)
178 }
179}
180
181func TestTMXTileNotLoadedTempFile(t *testing.T) {
182 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