-
Notifications
You must be signed in to change notification settings - Fork 84
/
loading_test.go
55 lines (49 loc) · 1.09 KB
/
loading_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package oak
import (
"os"
"testing"
"github.com/oakmound/oak/v4/scene"
)
func TestBatchLoad_HappyPath(t *testing.T) {
c1 := NewWindow()
c1.AddScene("1", scene.Scene{
Start: func(context *scene.Context) {
context.Window.Quit()
},
})
c1.Init("1", func(c Config) (Config, error) {
c.BatchLoad = true
c.Assets.AudioPath = "testdata/audio"
c.Assets.ImagePath = "testdata/images"
return c, nil
})
}
func TestBatchLoad_NotFound(t *testing.T) {
c1 := NewWindow()
c1.AddScene("1", scene.Scene{
Start: func(context *scene.Context) {
context.Window.Quit()
},
})
c1.Init("1", func(c Config) (Config, error) {
c.BatchLoad = true
return c, nil
})
}
func TestBatchLoad_Blank(t *testing.T) {
c1 := NewWindow()
c1.AddScene("1", scene.Scene{
Start: func(context *scene.Context) {
context.Window.Quit()
},
})
c1.Init("1", func(c Config) (Config, error) {
c.BatchLoad = true
c.BatchLoadOptions.BlankOutAudio = true
return c, nil
})
}
func TestSetBinaryPayload(t *testing.T) {
// coverage test, this utility is effectively tested in the render package
SetFS(os.DirFS("."))
}