grim/hgkeeper
Clone
Summary
Browse
Changes
Graph
Add binaries to the convey.yml
24 months ago, Gary Kramlich
6118b5de7042
Add binaries to the convey.yml
package
commands
import
(
"testing"
"github.com/stretchr/testify/assert"
)
type
testCase
struct
{
input
string
expected
Command
}
func
TestRepoFromCommand
(
t
*
testing
.
T
)
{
assert
:=
assert
.
New
(
t
)
cases
:=
[]
testCase
{
{
"hg serve --stdio"
,
NewServe
(
"repos"
,
""
),
},
{
"hg -R foo serve --stdio"
,
NewServe
(
"repos"
,
"foo"
),
},
{
"hg -R foo/bar serve --stdio"
,
NewServe
(
"repos"
,
"foo/bar"
),
},
}
for
_
,
testCase
:=
range
cases
{
cmd
,
err
:=
Find
(
testCase
.
input
,
"repos"
)
assert
.
Nil
(
err
)
assert
.
NotNil
(
cmd
)
assert
.
Equal
(
cmd
,
testCase
.
expected
)
}
}