From 2e1b5df9e30d4d6b79975d678470c7f56d5f91df Mon Sep 17 00:00:00 2001 From: Morgan Bazalgette Date: Mon, 25 Nov 2024 15:59:26 +0100 Subject: [PATCH] better doc --- gnovm/cmd/gno/test.go | 4 +--- gnovm/pkg/test/test.go | 12 +++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gnovm/cmd/gno/test.go b/gnovm/cmd/gno/test.go index cab580b2a68..04a3808718d 100644 --- a/gnovm/cmd/gno/test.go +++ b/gnovm/cmd/gno/test.go @@ -176,9 +176,7 @@ func execTest(cfg *testCfg, args []string, io commands.IO) error { return fmt.Errorf("list sub packages: %w", err) } - // Set-up testStore. - // Use a proxyWriter for stdout so that filetests can plug in a writer when - // necessary. + // Set up options to run tests. stdout := goio.Discard if cfg.verbose { stdout = io.Out() diff --git a/gnovm/pkg/test/test.go b/gnovm/pkg/test/test.go index b83af284fa6..9374db263ee 100644 --- a/gnovm/pkg/test/test.go +++ b/gnovm/pkg/test/test.go @@ -170,11 +170,13 @@ func (p *proxyWriter) tee(w io.Writer) (revert func()) { } } -func Test( - memPkg *gnovm.MemPackage, - fsDir string, // directory on filesystem of package; used for Sync - opts *TestOptions, -) error { +// Test runs tests on the specified memPkg. +// fsDir is the directory on filesystem of package; it's used in case opts.Sync +// is enabled, and points to the directory where the files are contained if they +// are to be updated. +// opts is a required set of options, which is often shared among different +// tests; you can use [NewTestOptions] for a common base configuration. +func Test(memPkg *gnovm.MemPackage, fsDir string, opts *TestOptions) error { opts.outWriter.w = opts.Output var errs error