mirror of https://github.com/markbates/pkger.git
33 lines
507 B
Go
33 lines
507 B
Go
package stdos
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/gobuffalo/here"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func Test_File_Stat_No_Info(t *testing.T) {
|
|
r := require.New(t)
|
|
|
|
her, err := here.Current()
|
|
r.NoError(err)
|
|
pkg, err := New(her)
|
|
r.NoError(err)
|
|
|
|
f, err := pkg.Open(":/pkging/stdos/file_test.go")
|
|
r.NoError(err)
|
|
defer f.Close()
|
|
|
|
sf, ok := f.(*File)
|
|
r.True(ok)
|
|
|
|
oi := sf.info
|
|
sf.info = nil
|
|
|
|
info, err := sf.Stat()
|
|
r.NoError(err)
|
|
r.Equal(oi.Name(), info.Name())
|
|
// r.Equal("", f.Name())
|
|
}
|