-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathgo-bindata_test.go
More file actions
43 lines (36 loc) · 812 Bytes
/
go-bindata_test.go
File metadata and controls
43 lines (36 loc) · 812 Bytes
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
package bindata
import (
"testing"
"github.com/golang-migrate/migrate/source/go_bindata/testdata"
st "github.com/golang-migrate/migrate/source/testing"
)
func Test(t *testing.T) {
// wrap assets into Resource first
s := Resource(testdata.AssetNames(),
func(name string) ([]byte, error) {
return testdata.Asset(name)
})
d, err := WithInstance(s)
if err != nil {
t.Fatal(err)
}
st.Test(t, d)
}
func TestWithInstance(t *testing.T) {
// wrap assets into Resource
s := Resource(testdata.AssetNames(),
func(name string) ([]byte, error) {
return testdata.Asset(name)
})
_, err := WithInstance(s)
if err != nil {
t.Fatal(err)
}
}
func TestOpen(t *testing.T) {
b := &Bindata{}
_, err := b.Open("")
if err == nil {
t.Fatal("expected err, because it's not implemented yet")
}
}