Commit 3881211d authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Run gofmt.

parent 305708cc
...@@ -92,6 +92,7 @@ func (me *OpenIn) String() string { ...@@ -92,6 +92,7 @@ func (me *OpenIn) String() string {
} }
type OsFileInfo os.FileInfo type OsFileInfo os.FileInfo
func (me OsFileInfo) String() string { func (me OsFileInfo) String() string {
return fmt.Sprintf( return fmt.Sprintf(
"{%s M0%o S=%d L=%d "+ "{%s M0%o S=%d L=%d "+
......
...@@ -823,9 +823,9 @@ func TestMemUnionResetAttr(t *testing.T) { ...@@ -823,9 +823,9 @@ func TestMemUnionResetAttr(t *testing.T) {
wd, ufs, clean := setupMemUfs(t) wd, ufs, clean := setupMemUfs(t)
defer clean() defer clean()
ioutil.WriteFile(wd + "/ro/fileattr", []byte{42}, 0644) ioutil.WriteFile(wd+"/ro/fileattr", []byte{42}, 0644)
before, _ := os.Lstat(wd + "/mnt/fileattr") before, _ := os.Lstat(wd + "/mnt/fileattr")
err := os.Chmod(wd + "/mnt/fileattr", 0606) err := os.Chmod(wd+"/mnt/fileattr", 0606)
CheckSuccess(err) CheckSuccess(err)
after, _ := os.Lstat(wd + "/mnt/fileattr") after, _ := os.Lstat(wd + "/mnt/fileattr")
testEq(t, after, before, false) testEq(t, after, before, false)
...@@ -837,9 +837,9 @@ func TestMemUnionResetAttr(t *testing.T) { ...@@ -837,9 +837,9 @@ func TestMemUnionResetAttr(t *testing.T) {
func TestMemUnionResetContent(t *testing.T) { func TestMemUnionResetContent(t *testing.T) {
wd, ufs, clean := setupMemUfs(t) wd, ufs, clean := setupMemUfs(t)
defer clean() defer clean()
ioutil.WriteFile(wd + "/ro/filecontents", []byte{42}, 0644) ioutil.WriteFile(wd+"/ro/filecontents", []byte{42}, 0644)
before, _ := ioutil.ReadFile(wd + "/mnt/filecontents") before, _ := ioutil.ReadFile(wd + "/mnt/filecontents")
ioutil.WriteFile(wd + "/mnt/filecontents", []byte{43}, 0644) ioutil.WriteFile(wd+"/mnt/filecontents", []byte{43}, 0644)
after, _ := ioutil.ReadFile(wd + "/mnt/filecontents") after, _ := ioutil.ReadFile(wd + "/mnt/filecontents")
testEq(t, after, before, false) testEq(t, after, before, false)
ufs.Reset() ufs.Reset()
...@@ -848,11 +848,10 @@ func TestMemUnionResetContent(t *testing.T) { ...@@ -848,11 +848,10 @@ func TestMemUnionResetContent(t *testing.T) {
testEq(t, afterReset, before, true) testEq(t, afterReset, before, true)
} }
func TestMemUnionResetDelete(t *testing.T) { func TestMemUnionResetDelete(t *testing.T) {
wd, ufs, clean := setupMemUfs(t) wd, ufs, clean := setupMemUfs(t)
defer clean() defer clean()
ioutil.WriteFile(wd + "/ro/todelete", []byte{42}, 0644) ioutil.WriteFile(wd+"/ro/todelete", []byte{42}, 0644)
before, _ := os.Lstat(wd + "/mnt/todelete") before, _ := os.Lstat(wd + "/mnt/todelete")
before.Ino = 0 before.Ino = 0
os.Remove(wd + "/mnt/todelete") os.Remove(wd + "/mnt/todelete")
...@@ -873,11 +872,11 @@ func clearInodes(infos []*os.FileInfo) { ...@@ -873,11 +872,11 @@ func clearInodes(infos []*os.FileInfo) {
func TestMemUnionResetDirEntry(t *testing.T) { func TestMemUnionResetDirEntry(t *testing.T) {
wd, ufs, clean := setupMemUfs(t) wd, ufs, clean := setupMemUfs(t)
defer clean() defer clean()
os.Mkdir(wd + "/ro/dir", 0755) os.Mkdir(wd+"/ro/dir", 0755)
ioutil.WriteFile(wd + "/ro/dir/todelete", []byte{42}, 0644) ioutil.WriteFile(wd+"/ro/dir/todelete", []byte{42}, 0644)
before, _ := ioutil.ReadDir(wd + "/mnt/dir") before, _ := ioutil.ReadDir(wd + "/mnt/dir")
clearInodes(before) clearInodes(before)
ioutil.WriteFile(wd + "/mnt/dir/newfile", []byte{42}, 0644) ioutil.WriteFile(wd+"/mnt/dir/newfile", []byte{42}, 0644)
os.Remove(wd + "/mnt/dir/todelete") os.Remove(wd + "/mnt/dir/todelete")
after, _ := ioutil.ReadDir(wd + "/mnt/dir") after, _ := ioutil.ReadDir(wd + "/mnt/dir")
clearInodes(after) clearInodes(after)
...@@ -891,11 +890,11 @@ func TestMemUnionResetDirEntry(t *testing.T) { ...@@ -891,11 +890,11 @@ func TestMemUnionResetDirEntry(t *testing.T) {
func TestMemUnionResetRename(t *testing.T) { func TestMemUnionResetRename(t *testing.T) {
wd, ufs, clean := setupMemUfs(t) wd, ufs, clean := setupMemUfs(t)
defer clean() defer clean()
os.Mkdir(wd + "/ro/dir", 0755) os.Mkdir(wd+"/ro/dir", 0755)
ioutil.WriteFile(wd + "/ro/dir/movesrc", []byte{42}, 0644) ioutil.WriteFile(wd+"/ro/dir/movesrc", []byte{42}, 0644)
before, _ := ioutil.ReadDir(wd + "/mnt/dir") before, _ := ioutil.ReadDir(wd + "/mnt/dir")
clearInodes(before) clearInodes(before)
os.Rename(wd + "/mnt/dir/movesrc", wd + "/mnt/dir/dest") os.Rename(wd+"/mnt/dir/movesrc", wd+"/mnt/dir/dest")
after, _ := ioutil.ReadDir(wd + "/mnt/dir") after, _ := ioutil.ReadDir(wd + "/mnt/dir")
clearInodes(after) clearInodes(after)
testEq(t, fuse.OsFileInfos(after), fuse.OsFileInfos(before), false) testEq(t, fuse.OsFileInfos(after), fuse.OsFileInfos(before), false)
......
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