Skip to content

Commit

Permalink
fix(test): handle empty args by assuming current directory for gno test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemanya8 committed Dec 30, 2024
1 parent 597f3f5 commit 4cb597b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions gnovm/cmd/gno/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ func (c *testCfg) RegisterFlags(fs *flag.FlagSet) {
}

func execTest(cfg *testCfg, args []string, io commands.IO) error {

Check failure on line 148 in gnovm/cmd/gno/test.go

View workflow job for this annotation

GitHub Actions / Run GnoVM suite / Go Lint / lint

unnecessary leading newline (whitespace)
if len(args) < 1 {
return flag.ErrHelp
}

// guess opts.RootDir
if cfg.rootDir == "" {
Expand All @@ -159,9 +156,9 @@ func execTest(cfg *testCfg, args []string, io commands.IO) error {
if err != nil {
return fmt.Errorf("list targets from patterns: %w", err)
}
// Assume current directory if no paths are provided
if len(paths) == 0 {
io.ErrPrintln("no packages to test")
return nil
paths = []string{"."}
}

if cfg.timeout > 0 {
Expand Down

0 comments on commit 4cb597b

Please sign in to comment.