1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

basic custom command test

This commit is contained in:
Jesse Duffield
2022-08-14 19:15:21 +10:00
parent 4aea005f26
commit 9c0d860980
23 changed files with 50 additions and 36 deletions

View File

@@ -4,8 +4,11 @@ import (
"log"
"os"
"os/exec"
"regexp"
"strconv"
"strings"
"github.com/jesseduffield/generics/slices"
"github.com/jesseduffield/lazygit/pkg/integration/components"
"github.com/jesseduffield/lazygit/pkg/integration/tests"
)
@@ -47,6 +50,14 @@ func getTestsToRun(testNames []string) []*components.IntegrationTest {
return tests.Tests
}
testNames = slices.Map(testNames, func(name string) string {
// allowing full test paths to be passed for convenience
return strings.TrimSuffix(
regexp.MustCompile(`.*pkg/integration/tests/`).ReplaceAllString(name, ""),
".go",
)
})
outer:
for _, testName := range testNames {
// check if our given test name actually exists