Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
bde0d1be
Commit
bde0d1be
authored
Jun 25, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MemFSTest.RenameWithinDir_SameName
parent
6ec382c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
samples/memfs/memfs_test.go
samples/memfs/memfs_test.go
+31
-2
No files found.
samples/memfs/memfs_test.go
View file @
bde0d1be
...
...
@@ -1370,8 +1370,37 @@ func (t *MemFSTest) RenameWithinDir_Directory() {
}
func
(
t
*
MemFSTest
)
RenameWithinDir_SameName
()
{
// TODO(jacobsa): Make sure to check what a real file system does here.
AssertTrue
(
false
,
"TODO"
)
var
err
error
// Create a parent directory.
parentPath
:=
path
.
Join
(
t
.
Dir
,
"parent"
)
err
=
os
.
Mkdir
(
parentPath
,
0700
)
AssertEq
(
nil
,
err
)
// And a file within it.
filePath
:=
path
.
Join
(
parentPath
,
"foo"
)
err
=
ioutil
.
WriteFile
(
filePath
,
[]
byte
(
"taco"
),
0400
)
AssertEq
(
nil
,
err
)
// Attempt to rename it.
err
=
os
.
Rename
(
filePath
,
filePath
)
AssertEq
(
nil
,
err
)
// The file should still exist.
contents
,
err
:=
ioutil
.
ReadFile
(
filePath
)
AssertEq
(
nil
,
err
)
ExpectEq
(
"taco"
,
string
(
contents
))
// There should only be the one entry in the directory.
entries
,
err
:=
fusetesting
.
ReadDirPicky
(
parentPath
)
AssertEq
(
nil
,
err
)
AssertEq
(
1
,
len
(
entries
))
fi
:=
entries
[
0
]
ExpectEq
(
path
.
Base
(
filePath
),
fi
.
Name
())
ExpectEq
(
os
.
FileMode
(
0400
),
fi
.
Mode
())
}
func
(
t
*
MemFSTest
)
RenameAcrossDirs_File
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment