quicktest icon indicating copy to clipboard operation
quicktest copied to clipboard

WIP: add support for registering source files

Open rogpeppe opened this issue 4 years ago • 0 comments

Note: WORK IN PROGRESS

From an idea from Brad Fitzpatrick, this makes it possible to show source code in test failures even when the source code isn't currently available.

Still to do: the quicktest-generate command, which would generate code looking something like the following:

package {{.Pkg}}

import (
	"embed"
	"testing"

	qt "github.com/frankban/quicktest"
)

//go:embed *_test.go
var _quicktestFiles embed.FS

func init() {
	qt.RegisterSource({{.Package}}, _quicktestFiles)
}

rogpeppe avatar May 12 '21 11:05 rogpeppe