Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
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
1
Merge Requests
1
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
nexedi
gitlab-workhorse
Commits
91043705
Commit
91043705
authored
Nov 29, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cast strings to []byte in tests
parent
7a84085b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
main_test.go
main_test.go
+3
-3
No files found.
main_test.go
View file @
91043705
...
...
@@ -209,7 +209,7 @@ func TestDownloadCacheHit(t *testing.T) {
if
err
:=
os
.
MkdirAll
(
cacheDir
,
0755
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
cachedContent
:=
[]
byte
{
'c'
,
'a'
,
'c'
,
'h'
,
'e'
,
'd'
}
cachedContent
:=
[]
byte
(
"cached"
)
if
err
:=
ioutil
.
WriteFile
(
path
.
Join
(
cacheDir
,
archiveName
),
cachedContent
,
0644
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
@@ -406,7 +406,7 @@ func allowedXSendfileDownload(t *testing.T, contentFilename string, filePath str
if
err
:=
os
.
MkdirAll
(
cacheDir
,
0755
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
contentBytes
:=
[]
byte
{
'c'
,
'o'
,
'n'
,
't'
,
'e'
,
'n'
,
't'
}
contentBytes
:=
[]
byte
(
"content"
)
if
err
:=
ioutil
.
WriteFile
(
contentPath
,
contentBytes
,
0644
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
@@ -449,7 +449,7 @@ func deniedXSendfileDownload(t *testing.T, contentFilename string, filePath stri
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
bytes
.
Compare
(
actual
,
[]
byte
{
'D'
,
'e'
,
'n'
,
'i'
,
'e'
,
'd'
}
)
!=
0
{
if
bytes
.
Compare
(
actual
,
[]
byte
(
"Denied"
)
)
!=
0
{
t
.
Fatal
(
"Unexpected file contents in download"
)
}
}
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