envying the irony that is rock and roll

This commit is contained in:
Mark Bates 2019-09-01 00:03:01 -04:00
parent 915694eb9d
commit f05a546d9e
1 changed files with 25 additions and 1 deletions

View File

@ -125,7 +125,31 @@ func (s *FileSystem) Test_Open(t *testing.T) {
}
func (s *FileSystem) Test_Parse(t *testing.T) {
panic("not implemented")
r := require.New(t)
cur, err := s.Current()
r.NoError(err)
ip := cur.ImportPath
table := []struct {
in string
exp fs.Path
}{
{in: "/foo.go", exp: fs.Path{Pkg: ip, Name: "/foo.go"}},
{in: ":/foo.go", exp: fs.Path{Pkg: ip, Name: "/foo.go"}},
{in: ip + ":/foo.go", exp: fs.Path{Pkg: ip, Name: "/foo.go"}},
{in: ip, exp: fs.Path{Pkg: ip, Name: "/"}},
}
for _, tt := range table {
t.Run(tt.in, func(st *testing.T) {
r := require.New(st)
pt, err := s.Parse(tt.in)
r.NoError(err)
r.Equal(tt.exp, pt)
})
}
}
func (s *FileSystem) Test_ReadFile(t *testing.T) {