Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
e8bc42d8
Commit
e8bc42d8
authored
Feb 26, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add certificate_test.go.
parent
b3727824
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
webserver/certificate_test.go
webserver/certificate_test.go
+51
-0
No files found.
webserver/certificate_test.go
0 → 100644
View file @
e8bc42d8
package
webserver
import
(
"testing"
)
func
TestGenerateCertificate
(
t
*
testing
.
T
)
{
_
,
err
:=
generateCertificate
()
if
err
!=
nil
{
t
.
Errorf
(
"generateCertificate: %v"
,
err
)
}
}
func
BenchmarkGenerateCertificate
(
b
*
testing
.
B
)
{
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
_
,
err
:=
generateCertificate
()
if
err
!=
nil
{
b
.
Errorf
(
"generateCertificate: %v"
,
err
)
}
}
}
func
TestGetCertificate
(
t
*
testing
.
T
)
{
cert1
,
err
:=
getCertificate
(
"/tmp/no/such/file"
)
if
err
!=
nil
{
t
.
Errorf
(
"getCertificate: %v"
,
err
)
}
cert2
,
err
:=
getCertificate
(
"/tmp/no/such/file"
)
if
err
!=
nil
{
t
.
Errorf
(
"getCertificate: %v"
,
err
)
}
if
cert1
!=
cert2
{
t
.
Errorf
(
"cert1 != cert2"
)
}
}
func
BenchmarkGetCertificate
(
b
*
testing
.
B
)
{
_
,
err
:=
getCertificate
(
"/tmp/no/such/file"
)
if
err
!=
nil
{
b
.
Errorf
(
"getCertificate: %v"
,
err
)
}
b
.
StartTimer
()
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
_
,
err
:=
getCertificate
(
"/tmp/no/such/file"
)
if
err
!=
nil
{
b
.
Errorf
(
"getCertificate: %v"
,
err
)
}
}
}
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