mirror of https://github.com/markbates/pkger.git
30 lines
431 B
Go
30 lines
431 B
Go
package stdos
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func Test_File_Stat_No_Info(t *testing.T) {
|
|
r := require.New(t)
|
|
|
|
pkg, err := New()
|
|
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())
|
|
}
|