snapshot of https://github.com/golang-migrate/migrate.git (master, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
43
source/go_bindata/go-bindata_test.go
Normal file
43
source/go_bindata/go-bindata_test.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package bindata
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/golang-migrate/migrate/v4/source/go_bindata/testdata"
|
||||
st "github.com/golang-migrate/migrate/v4/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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user