Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
acf12b6e
Commit
acf12b6e
authored
Jul 19, 2018
by
Lucas Molas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfs: seek to 0 before reading in `TestTruncateAndWrite`
License: MIT Signed-off-by:
Lucas Molas
<
schomatis@gmail.com
>
parent
6f140d25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
mfs/mfs_test.go
mfs/mfs_test.go
+7
-1
No files found.
mfs/mfs_test.go
View file @
acf12b6e
...
...
@@ -1167,12 +1167,18 @@ func TestTruncateAndWrite(t *testing.T) {
if
l
!=
len
(
"test"
)
{
t
.
Fatal
(
"incorrect write length"
)
}
_
,
err
=
fd
.
Seek
(
0
,
io
.
SeekStart
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
data
,
err
:=
ioutil
.
ReadAll
(
fd
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
string
(
data
)
!=
"test"
{
t
.
Error
f
(
"read error at read %d, read: %v"
,
i
,
data
)
t
.
Fatal
f
(
"read error at read %d, read: %v"
,
i
,
data
)
}
}
}
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