Skip to content

Commit 8143247

Browse files
authored
Merge pull request #1128 from carapace-sh/testmain
use TestMain
2 parents df98586 + 10e4747 commit 8143247

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

action_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ import (
1414
"github.com/carapace-sh/carapace/pkg/uid"
1515
)
1616

17-
func init() {
18-
os.Unsetenv("LS_COLORS")
19-
}
20-
2117
func assertEqual(t *testing.T, expected, actual InvokedAction) {
2218
sort.Sort(common.ByValue(expected.action.rawValues))
2319
sort.Sort(common.ByValue(actual.action.rawValues))

carapace_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import (
1111
"github.com/spf13/cobra"
1212
)
1313

14-
func init() {
14+
func TestMain(m *testing.M) {
1515
os.Unsetenv("LS_COLORS")
16+
os.Exit(m.Run())
1617
}
1718

1819
func execCompletion(args ...string) (context Context) {

0 commit comments

Comments
 (0)