grim/hgkeeper
Clone
Summary
Browse
Changes
Graph
Remove the mercurial 6.1 pin from the container image
23 months ago, Gary Kramlich
653b933ba715
Remove the mercurial 6.1 pin from the container image
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
)
}
}