From 4cb597b6fa9d40e8becd3ab8beb02d44b3447de8 Mon Sep 17 00:00:00 2001 From: Nemanya8 Date: Mon, 30 Dec 2024 12:08:26 -0500 Subject: [PATCH] fix(test): handle empty args by assuming current directory for gno test --- gnovm/cmd/gno/test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gnovm/cmd/gno/test.go b/gnovm/cmd/gno/test.go index fec0de7c221..59ecb6550a2 100644 --- a/gnovm/cmd/gno/test.go +++ b/gnovm/cmd/gno/test.go @@ -146,9 +146,6 @@ func (c *testCfg) RegisterFlags(fs *flag.FlagSet) { } func execTest(cfg *testCfg, args []string, io commands.IO) error { - if len(args) < 1 { - return flag.ErrHelp - } // guess opts.RootDir if cfg.rootDir == "" { @@ -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 {