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-unixfs
Commits
ae6f00d7
Commit
ae6f00d7
authored
Nov 19, 2014
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: Fixed tests
parent
4c1a5f68
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
commands/cli/parse_test.go
commands/cli/parse_test.go
+1
-1
commands/command_test.go
commands/command_test.go
+5
-5
No files found.
commands/cli/parse_test.go
View file @
ae6f00d7
...
...
@@ -11,7 +11,7 @@ func TestOptionParsing(t *testing.T) {
subCmd
:=
&
commands
.
Command
{}
cmd
:=
&
commands
.
Command
{
Options
:
[]
commands
.
Option
{
commands
.
Option
{
Names
:
[]
string
{
"b"
}
,
Type
:
commands
.
String
}
,
commands
.
StringOption
(
"b"
,
"some option"
)
,
},
Subcommands
:
map
[
string
]
*
commands
.
Command
{
"test"
:
subCmd
,
...
...
commands/command_test.go
View file @
ae6f00d7
...
...
@@ -9,8 +9,8 @@ func noop(req Request) (interface{}, error) {
func
TestOptionValidation
(
t
*
testing
.
T
)
{
cmd
:=
Command
{
Options
:
[]
Option
{
Option
{[]
string
{
"b"
,
"beep"
},
Int
,
"enables beeper"
}
,
Option
{[]
string
{
"B"
,
"boop"
},
String
,
"password for booper"
}
,
Int
Option
(
"b"
,
"beep"
,
"enables beeper"
)
,
StringOption
(
"B"
,
"boop"
,
"password for booper"
)
,
},
Run
:
noop
,
}
...
...
@@ -93,14 +93,14 @@ func TestOptionValidation(t *testing.T) {
func
TestRegistration
(
t
*
testing
.
T
)
{
cmdA
:=
&
Command
{
Options
:
[]
Option
{
Option
{[]
string
{
"beep"
},
Int
,
"number of beeps"
}
,
Int
Option
(
"beep"
,
"number of beeps"
)
,
},
Run
:
noop
,
}
cmdB
:=
&
Command
{
Options
:
[]
Option
{
Option
{[]
string
{
"beep"
},
Int
,
"number of beeps"
}
,
Int
Option
(
"beep"
,
"number of beeps"
)
,
},
Run
:
noop
,
Subcommands
:
map
[
string
]
*
Command
{
...
...
@@ -110,7 +110,7 @@ func TestRegistration(t *testing.T) {
cmdC
:=
&
Command
{
Options
:
[]
Option
{
Option
{[]
string
{
"encoding"
},
String
,
"data encoding type"
}
,
StringOption
(
"encoding"
,
"data encoding type"
)
,
},
Run
:
noop
,
}
...
...
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