Commit 8fc315cf authored by Aaron Jacobs's avatar Aaron Jacobs

MemFSTest.CaseSensitive

parent b2a8322a
......@@ -440,3 +440,31 @@ func (t *MemFSTest) Rmdir_OpenedForReading() {
AssertEq(nil, err)
ExpectThat(entries, ElementsAre())
}
func (t *MemFSTest) CaseSensitive() {
var err error
// Create a file.
err = ioutil.WriteFile(path.Join(t.mfs.Dir(), "file"), []byte{}, 0400)
AssertEq(nil, err)
// Create a directory.
err = os.Mkdir(path.Join(t.mfs.Dir(), "dir"), 0400)
AssertEq(nil, err)
// Attempt to stat with the wrong case.
names := []string{
"FILE",
"File",
"filE",
"DIR",
"Dir",
"dIr",
}
for _, name := range names {
_, err = os.Stat(path.Join(t.mfs.Dir(), name))
AssertNe(nil, err, "Name: %s", name)
AssertThat(err, Error(HasSubstr("no such file or directory")))
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment