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-cmds
Commits
6e294c30
Commit
6e294c30
authored
Oct 15, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Oct 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: Fixed tests
parent
18c50f34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
command_test.go
command_test.go
+9
-9
response_test.go
response_test.go
+1
-1
No files found.
command_test.go
View file @
6e294c30
...
...
@@ -11,14 +11,14 @@ func TestOptionValidation(t *testing.T) {
f
:
func
(
req
*
Request
,
res
*
Response
)
{},
}
req
:=
NewRequest
()
req
:=
New
Empty
Request
()
req
.
options
[
"foo"
]
=
5
res
:=
cmd
.
Call
(
req
)
if
res
.
Error
==
nil
{
t
.
Error
(
"Should have failed (unrecognized option)"
)
}
req
=
NewRequest
()
req
=
New
Empty
Request
()
req
.
options
[
"beep"
]
=
5
req
.
options
[
"b"
]
=
10
res
=
cmd
.
Call
(
req
)
...
...
@@ -26,21 +26,21 @@ func TestOptionValidation(t *testing.T) {
t
.
Error
(
"Should have failed (duplicate options)"
)
}
req
=
NewRequest
()
req
=
New
Empty
Request
()
req
.
options
[
"beep"
]
=
"foo"
res
=
cmd
.
Call
(
req
)
if
res
.
Error
==
nil
{
t
.
Error
(
"Should have failed (incorrect type)"
)
}
req
=
NewRequest
()
req
=
New
Empty
Request
()
req
.
options
[
"beep"
]
=
5
res
=
cmd
.
Call
(
req
)
if
res
.
Error
!=
nil
{
t
.
Error
(
res
.
Error
,
"Should have passed"
)
}
req
=
NewRequest
()
req
=
New
Empty
Request
()
req
.
options
[
"beep"
]
=
5
req
.
options
[
"boop"
]
=
"test"
res
=
cmd
.
Call
(
req
)
...
...
@@ -48,7 +48,7 @@ func TestOptionValidation(t *testing.T) {
t
.
Error
(
"Should have passed"
)
}
req
=
NewRequest
()
req
=
New
Empty
Request
()
req
.
options
[
"b"
]
=
5
req
.
options
[
"B"
]
=
"test"
res
=
cmd
.
Call
(
req
)
...
...
@@ -56,21 +56,21 @@ func TestOptionValidation(t *testing.T) {
t
.
Error
(
"Should have passed"
)
}
req
=
NewRequest
()
req
=
New
Empty
Request
()
req
.
options
[
"enc"
]
=
"json"
res
=
cmd
.
Call
(
req
)
if
res
.
Error
!=
nil
{
t
.
Error
(
"Should have passed"
)
}
req
=
NewRequest
()
req
=
New
Empty
Request
()
req
.
options
[
"b"
]
=
"100"
res
=
cmd
.
Call
(
req
)
if
res
.
Error
!=
nil
{
t
.
Error
(
"Should have passed"
)
}
req
=
NewRequest
()
req
=
New
Empty
Request
()
req
.
options
[
"b"
]
=
":)"
res
=
cmd
.
Call
(
req
)
if
res
.
Error
==
nil
{
...
...
response_test.go
View file @
6e294c30
...
...
@@ -11,7 +11,7 @@ type TestOutput struct {
}
func
TestMarshalling
(
t
*
testing
.
T
)
{
req
:=
NewRequest
()
req
:=
New
Empty
Request
()
res
:=
Response
{
req
:
req
,
...
...
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