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

Function TestFilesLoad

assets_test.go:69–90  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

67}
68
69func TestFilesLoad(t *testing.T) {
70 Files.Register(".test", &testLoader{})
71
72 content := []byte("testing")
73 dir, err := ioutil.TempDir(".", "testing")
74 if err != nil {
75 t.Errorf("failed to create temp directory for testing, error: %v", err)
76 }
77 defer os.RemoveAll(dir)
78
79 Files.SetRoot(dir)
80
81 tmpfn := filepath.Join(dir, "test1.test")
82
83 if err = ioutil.WriteFile(tmpfn, content, 0666); err != nil {
84 t.Errorf("failed to create temp file for testing, file: %v, error: %v", tmpfn, err)
85 }
86
87 if err = Files.Load("test1.test"); err != nil {
88 t.Errorf("could not load test file %v, error: %v", "test1.test", err)
89 }
90}
91
92func TestFilesMultipleLoad(t *testing.T) {
93 Files.Register(".test", &testLoader{})

Callers

nothing calls this directly

Calls 3

SetRootMethod · 0.65
LoadMethod · 0.65
RegisterMethod · 0.45

Tested by

no test coverage detected