diff --git a/examples/gno.land/p/demo/tests/subtests/subtests_test.gno b/examples/gno.land/p/demo/tests/subtests/subtests_test.gno new file mode 100644 index 00000000000..e3ea2c600c4 --- /dev/null +++ b/examples/gno.land/p/demo/tests/subtests/subtests_test.gno @@ -0,0 +1,5 @@ +package subtests_test + +func TestPrivate(t *testing.T) { + println("hello from private test") +} diff --git a/gnovm/cmd/gno/test.go b/gnovm/cmd/gno/test.go index f2292f80747..fd9271ca22c 100644 --- a/gnovm/cmd/gno/test.go +++ b/gnovm/cmd/gno/test.go @@ -241,11 +241,9 @@ func gnoTestPkg( stdin = io.In stdout = io.Out stderr = io.Err + errs error ) - filter := splitRegexp(runFlag) - var errs error - mode := tests.ImportModeStdlibsOnly if cfg.withNativeFallback { // XXX: display a warn? @@ -310,6 +308,7 @@ func gnoTestPkg( for _, testFile := range filetestFiles { testFileName := filepath.Base(testFile) testName := "file/" + testFileName + filter := splitRegexp(runFlag) if !shouldRun(filter, testName) { continue } diff --git a/gnovm/stdlibs/testing/match.gno b/gnovm/stdlibs/testing/match.gno index 5b7f509d8f6..13a7edd4f27 100644 --- a/gnovm/stdlibs/testing/match.gno +++ b/gnovm/stdlibs/testing/match.gno @@ -166,13 +166,13 @@ func isSpace(r rune) bool { return false } -var ( - matchPat string - matchRe *regexp.Regexp -) - // based on testing/internal/testdeps.TestDeps.MatchString. func matchString(pat, str string) (result bool, err error) { + var ( + matchPat string + matchRe *regexp.Regexp + ) + if matchRe == nil || matchPat != pat { matchPat = pat matchRe, err = regexp.Compile(matchPat)