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
45ab9845
Commit
45ab9845
authored
Jun 25, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved rename tests.
parent
3440c23d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
samples/memfs/memfs_test.go
samples/memfs/memfs_test.go
+28
-3
No files found.
samples/memfs/memfs_test.go
View file @
45ab9845
...
...
@@ -1327,10 +1327,10 @@ func (t *MemFSTest) RenameWithinDir_Directory() {
err
=
os
.
Mkdir
(
parentPath
,
0700
)
AssertEq
(
nil
,
err
)
// And a directory within it.
// And a
non-empty
directory within it.
oldPath
:=
path
.
Join
(
parentPath
,
"foo"
)
err
=
os
.
Mkdir
(
oldPath
,
0700
)
err
=
os
.
Mkdir
All
(
path
.
Join
(
oldPath
,
"child"
)
,
0700
)
AssertEq
(
nil
,
err
)
// Rename it.
...
...
@@ -1349,7 +1349,7 @@ func (t *MemFSTest) RenameWithinDir_Directory() {
ExpectEq
(
len
(
"taco"
),
fi
.
Size
())
ExpectTrue
(
fi
.
IsDir
())
// There should only be the new entry in the
directory
.
// There should only be the new entry in the
parent
.
entries
,
err
:=
fusetesting
.
ReadDirPicky
(
parentPath
)
AssertEq
(
nil
,
err
)
AssertEq
(
1
,
len
(
entries
))
...
...
@@ -1357,6 +1357,15 @@ func (t *MemFSTest) RenameWithinDir_Directory() {
ExpectEq
(
path
.
Base
(
newPath
),
fi
.
Name
())
ExpectTrue
(
fi
.
IsDir
())
// And the child should still be present.
entries
,
err
=
fusetesting
.
ReadDirPicky
(
newPath
)
AssertEq
(
nil
,
err
)
AssertEq
(
1
,
len
(
entries
))
fi
=
entries
[
0
]
ExpectEq
(
"child"
,
fi
.
Name
())
ExpectTrue
(
fi
.
IsDir
())
}
func
(
t
*
MemFSTest
)
RenameAcrossDirs_File
()
{
...
...
@@ -1366,3 +1375,19 @@ func (t *MemFSTest) RenameAcrossDirs_File() {
func
(
t
*
MemFSTest
)
RenameAcrossDirs_Directory
()
{
AssertTrue
(
false
,
"TODO"
)
}
func
(
t
*
MemFSTest
)
RenameOutOfFileSystem_File
()
{
AssertTrue
(
false
,
"TODO"
)
}
func
(
t
*
MemFSTest
)
RenameOutOfFileSystem_Directory
()
{
AssertTrue
(
false
,
"TODO"
)
}
func
(
t
*
MemFSTest
)
RenameIntoFileSystem_File
()
{
AssertTrue
(
false
,
"TODO"
)
}
func
(
t
*
MemFSTest
)
RenameIntoFileSystem_Directory
()
{
AssertTrue
(
false
,
"TODO"
)
}
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