grim/hgkeeper
Clone
Summary
Browse
Changes
Graph
Add `go 1.11` to the bottom of go.mod and run `go mod tidy`
2019-09-10, Gary Kramlich
21e7408ca1a0
Add `go 1.11` to the bottom of go.mod and run `go mod tidy`
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
)
}
}