Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
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
nexedi
caddy
Commits
0feb0d92
Commit
0feb0d92
authored
Oct 19, 2015
by
Paulo L F Casaretto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test validDirective function
parent
1db138ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
config/config_test.go
config/config_test.go
+20
-0
No files found.
config/config_test.go
View file @
0feb0d92
...
@@ -102,3 +102,23 @@ func TestMakeStorages(t *testing.T) {
...
@@ -102,3 +102,23 @@ func TestMakeStorages(t *testing.T) {
t
.
Errorf
(
"storages was %v, expected %v"
,
storages
,
expected
)
t
.
Errorf
(
"storages was %v, expected %v"
,
storages
,
expected
)
}
}
}
}
func
TestValidDirective
(
t
*
testing
.
T
)
{
directives
:=
[]
directive
{
{
"dummy"
,
nil
},
{
"dummy2"
,
nil
},
}
directiveOrder
=
directives
for
i
,
test
:=
range
[]
struct
{
directive
string
valid
bool
}{
{
"dummy"
,
true
},
{
"dummy2"
,
true
},
{
"dummy3"
,
false
},
}
{
if
actual
,
expected
:=
validDirective
(
test
.
directive
),
test
.
valid
;
actual
!=
expected
{
t
.
Errorf
(
"Test %d: valid was %t, expected %t"
,
i
,
actual
,
expected
)
}
}
}
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