Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
harry-hov committed Sep 28, 2023
1 parent 42f1938 commit cef6b80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func execTest(cfg *testCfg, args []string, io *commands.IO) error {
cfg.rootDir = guessRootDir()
}

paths, err := targetFromPatterns(args)
paths, err := targetsFromPatterns(args)

Check warning on line 185 in gnovm/cmd/gno/test.go

View check run for this annotation

Codecov / codecov/patch

gnovm/cmd/gno/test.go#L185

Added line #L185 was not covered by tests
if err != nil {
return fmt.Errorf("list targets from patterns: %w", err)

Check warning on line 187 in gnovm/cmd/gno/test.go

View check run for this annotation

Codecov / codecov/patch

gnovm/cmd/gno/test.go#L187

Added line #L187 was not covered by tests
}
Expand Down
10 changes: 5 additions & 5 deletions gnovm/cmd/gno/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ func gnoPackagesFromArgs(args []string) ([]string, error) {
return paths, nil
}

// targetFromPatterns returns a list of target paths that match the patterns.
// targetsFromPatterns returns a list of target paths that match the patterns.
// Each pattern can represent a file or a directory, and if the pattern
// includes `/...“, it signifies a directory search.
// includes "/...", the "..." is treated as a wildcard, matching any string.
// Intended to be used by gno commands such as `gno test`.
func targetFromPatterns(patterns []string) ([]string, error) {
func targetsFromPatterns(patterns []string) ([]string, error) {
paths := []string{}
for _, p := range patterns {
var match func(string) bool
Expand Down Expand Up @@ -174,8 +174,8 @@ func targetFromPatterns(patterns []string) ([]string, error) {
// name matches pattern. Pattern is a limited glob
// pattern in which '...' means 'any string' and there
// is no other special syntax.
// Stolen from the go tool
// Taken from: https://github.com/rogpeppe/showdeps/blob/master/showdeps.go
// Simplified version of go source's matchPatternInternal
// (see $GOROOT/src/cmd/internal/pkgpattern)
func matchPattern(pattern string) func(name string) bool {
re := regexp.QuoteMeta(pattern)
re = strings.Replace(re, `\.\.\.`, `.*`, -1)
Expand Down

0 comments on commit cef6b80

Please sign in to comment.