Skip to content

Commit

Permalink
Added FakeGCS.ForeignModsTest.FileAndDirectoryWithConflictingName.
Browse files Browse the repository at this point in the history
Currently it just nails down the existing behavior. See #28.
  • Loading branch information
jacobsa committed Mar 26, 2015
1 parent a249338 commit ab35779
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions fs/fstesting/foreign_modifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,48 @@ func (t *foreignModsTest) UnreachableObjects() {
ExpectTrue(os.IsNotExist(err), "err: %v", err)
}

func (t *foreignModsTest) FileAndDirectoryWithConflictingName() {
var fi os.FileInfo
var err error

// Set up an object named "foo" and one named "foo/", plus a child for the
// latter.
AssertEq(
nil,
t.createObjects(
[]*gcsutil.ObjectInfo{
// File
&gcsutil.ObjectInfo{
Attrs: storage.ObjectAttrs{
Name: "foo",
},
Contents: "taco",
},

// Directory
&gcsutil.ObjectInfo{
Attrs: storage.ObjectAttrs{
Name: "foo/",
},
},

// Directory child
&gcsutil.ObjectInfo{
Attrs: storage.ObjectAttrs{
Name: "foo/bar",
},
Contents: "",
},
}))

// Statting "foo" should yield the directory.
fi, err = os.Stat(path.Join(t.mfs.Dir(), "foo"))
AssertEq(nil, err)

ExpectEq("foo", fi.Name())
ExpectTrue(fi.IsDir())
}

func (t *foreignModsTest) Inodes() {
// Set up two files and a directory placeholder.
AssertEq(
Expand Down

0 comments on commit ab35779

Please sign in to comment.