grim/hgkeeper
Clone
Summary
Browse
Changes
Graph
Update to go 1.20 in go mod and the container
14 months ago, Gary Kramlich
7dc04c05874e
Update to go 1.20 in go mod and the container
package
hg
import
(
"testing"
"github.com/stretchr/testify/assert"
)
func
TestFindHgrcsForRepoSimple
(
t
*
testing
.
T
)
{
actual
:=
findHgrcsForRepo
(
"grim/hgkeeper"
)
expected
:=
[]
string
{
"config/hgrc"
,
"config/grim/hgrc"
,
"config/grim/hgkeeper/hgrc"
,
}
assert
.
Equal
(
t
,
expected
,
actual
)
}
func
TestFindHgrcsForRepoEmpty
(
t
*
testing
.
T
)
{
actual
:=
findHgrcsForRepo
(
""
)
expected
:=
[]
string
{
"config/hgrc"
,
}
assert
.
Equal
(
t
,
expected
,
actual
)
}
func
TestFindHgrcsForRepoDot
(
t
*
testing
.
T
)
{
actual
:=
findHgrcsForRepo
(
"."
)
expected
:=
[]
string
{
"config/hgrc"
,
}
assert
.
Equal
(
t
,
expected
,
actual
)
}
func
TestFindHgrcsForRepoAbsolute
(
t
*
testing
.
T
)
{
actual
:=
findHgrcsForRepo
(
"/grim/testing/abc123"
)
expected
:=
[]
string
{
"config/hgrc"
,
"config/grim/hgrc"
,
"config/grim/testing/hgrc"
,
"config/grim/testing/abc123/hgrc"
,
}
assert
.
Equal
(
t
,
expected
,
actual
)
}