github.com/dannyzhou2015/migrate/v4@v4.15.2/source/go_bindata/go-bindata_test.go (about) 1 package bindata 2 3 import ( 4 "testing" 5 6 "github.com/dannyzhou2015/migrate/v4/source/go_bindata/testdata" 7 st "github.com/dannyzhou2015/migrate/v4/source/testing" 8 ) 9 10 func Test(t *testing.T) { 11 // wrap assets into Resource first 12 s := Resource(testdata.AssetNames(), 13 func(name string) ([]byte, error) { 14 return testdata.Asset(name) 15 }) 16 17 d, err := WithInstance(s) 18 if err != nil { 19 t.Fatal(err) 20 } 21 st.Test(t, d) 22 } 23 24 func TestWithInstance(t *testing.T) { 25 // wrap assets into Resource 26 s := Resource(testdata.AssetNames(), 27 func(name string) ([]byte, error) { 28 return testdata.Asset(name) 29 }) 30 31 _, err := WithInstance(s) 32 if err != nil { 33 t.Fatal(err) 34 } 35 } 36 37 func TestOpen(t *testing.T) { 38 b := &Bindata{} 39 _, err := b.Open("") 40 if err == nil { 41 t.Fatal("expected err, because it's not implemented yet") 42 } 43 }