MemFSTest.HardLinks

geesefs-0-30-9
Aaron Jacobs 2015-05-19 15:21:07 +10:00
parent ba58fa8721
commit c478c23404
1 changed files with 17 additions and 1 deletions

View File

@ -1116,7 +1116,23 @@ func (t *MemFSTest) ReadDirWhileModifying() {
}
func (t *MemFSTest) HardLinks() {
AssertTrue(false, "TODO")
var err error
// Create a file and a directory.
fileName := path.Join(t.Dir, "foo")
err = ioutil.WriteFile(fileName, []byte{}, 0400)
AssertEq(nil, err)
dirName := path.Join(t.Dir, "bar")
err = os.Mkdir(dirName, 0700)
AssertEq(nil, err)
// Attempt to link each. Neither should work, but for different reasons.
err = os.Link(fileName, path.Join(t.Dir, "baz"))
ExpectThat(err, Error(HasSubstr("not implemented")))
err = os.Link(dirName, path.Join(t.Dir, "baz"))
ExpectThat(err, Error(HasSubstr("not permitted")))
}
func (t *MemFSTest) CreateSymlink() {