Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Commit

Permalink
envying the irony that is rock and roll
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Sep 1, 2019
1 parent 915694e commit f05a546
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion fs/fstest/suite.go
Expand Up @@ -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) {
Expand Down

0 comments on commit f05a546

Please sign in to comment.