pkger/pkging/stdos/file_test.go

30 lines
431 B
Go
Raw Normal View History

2019-09-20 17:56:26 +03:00
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())
}