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
fcf3be28
Commit
fcf3be28
authored
Mar 05, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PosixTest.ReadsPastEndOfFile
parent
95a89e53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
+30
-8
samples/memfs/posix_test.go
samples/memfs/posix_test.go
+30
-8
No files found.
samples/memfs/posix_test.go
View file @
fcf3be28
...
...
@@ -218,14 +218,36 @@ func (t *PosixTest) WriteAtDoesntChangeOffset_AppendMode() {
ExpectEq
(
4
,
offset
)
}
func
(
t
*
PosixTest
)
ReadOverlapsEndOfFile
()
{
AssertTrue
(
false
,
"TODO"
)
}
func
(
t
*
PosixTest
)
ReadsPastEndOfFile
()
{
var
err
error
var
n
int
buf
:=
make
([]
byte
,
1024
)
func
(
t
*
PosixTest
)
ReadStartsAtEndOfFile
()
{
AssertTrue
(
false
,
"TODO"
)
}
// Create a file.
f
,
err
:=
os
.
Create
(
path
.
Join
(
t
.
dir
,
"foo"
))
t
.
toClose
=
append
(
t
.
toClose
,
f
)
AssertEq
(
nil
,
err
)
// Give it some contents.
n
,
err
=
f
.
Write
([]
byte
(
"taco"
))
AssertEq
(
nil
,
err
)
AssertEq
(
4
,
n
)
func
(
t
*
PosixTest
)
ReadStartsPastEndOfFile
()
{
AssertTrue
(
false
,
"TODO"
)
// Read a range overlapping EOF.
n
,
err
=
f
.
ReadAt
(
buf
[
:
4
],
2
)
AssertEq
(
io
.
EOF
,
err
)
ExpectEq
(
2
,
n
)
ExpectEq
(
"co"
,
string
(
buf
[
:
n
]))
// Read a range starting at EOF.
n
,
err
=
f
.
ReadAt
(
buf
[
:
4
],
4
)
AssertEq
(
io
.
EOF
,
err
)
ExpectEq
(
0
,
n
)
ExpectEq
(
""
,
string
(
buf
[
:
n
]))
// Read a range starting past EOF.
n
,
err
=
f
.
ReadAt
(
buf
[
:
4
],
100
)
AssertEq
(
io
.
EOF
,
err
)
ExpectEq
(
0
,
n
)
ExpectEq
(
""
,
string
(
buf
[
:
n
]))
}
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