func CompileTest(
	fn *ast.Test,
	file *vm.File,
	constants map[string]*ast.Literal,
	imports map[string]*types.Type,
) (*vm.CompiledTest, error) {
	compiledFunc, err := CompileFunc(&ast.Func{
		Statements: fn.Statements,
		Pos:        fn.Pos,
	}, file, nil, constants, imports, map[string]*types.Type{})
	if err != nil {
		return nil, err
	}
	return &vm.CompiledTest{
		CompiledFunc: compiledFunc,
		TestName:     fn.Name,
	}, nil
}
CompileTest will compile a test.
package compiler
import (
	"github.com/elliotchance/ok/ast"
	"github.com/elliotchance/ok/types"
	"github.com/elliotchance/ok/vm"
)