Skip to content

Commit d7513ef

Browse files
committed
Fix test assertion when running on Windows
1 parent e93ab66 commit d7513ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

git/git_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package git
33
import (
44
"fmt"
55
"os"
6-
"strings"
6+
"regexp"
77
"testing"
88

99
"github.com/github/gh-cli/test"
@@ -51,7 +51,8 @@ func Test_UncommittedChangeCount(t *testing.T) {
5151

5252
GitCommand = test.StubExecCommand("TestGitStatusHelperProcess", "boom")
5353
_, err := UncommittedChangeCount()
54-
if !strings.HasSuffix(err.Error(), "git.test: exit status 1") {
54+
errorRE := regexp.MustCompile(`git\.test(\.exe)?: exit status 1$`)
55+
if !errorRE.MatchString(err.Error()) {
5556
t.Errorf("got unexpected error message: %s", err)
5657
}
5758
}

0 commit comments

Comments
 (0)