TestErrImport
This commit is contained in:
@@ -29,6 +29,7 @@ import (
|
||||
|
||||
func TestCollectSkipNames(t *testing.T) {
|
||||
ctx := &context{skips: make(map[string]none)}
|
||||
ctx.collectSkipNames("//llgo:skipall")
|
||||
ctx.collectSkipNames("//llgo:skip")
|
||||
ctx.collectSkipNames("//llgo:skip abs")
|
||||
}
|
||||
@@ -219,6 +220,13 @@ func TestErrImport(t *testing.T) {
|
||||
var ctx context
|
||||
pkg := types.NewPackage("foo", "foo")
|
||||
ctx.importPkg(pkg, nil)
|
||||
|
||||
alt := types.NewPackage("bar", "bar")
|
||||
alt.Scope().Insert(
|
||||
types.NewConst(0, alt, "LLGoPackage", types.Typ[types.String], constant.MakeString("noinit")),
|
||||
)
|
||||
ctx.patches = Patches{"foo": &ssa.Package{Pkg: alt}}
|
||||
ctx.importPkg(pkg, &pkgInfo{})
|
||||
}
|
||||
|
||||
func TestErrInitLinkname(t *testing.T) {
|
||||
|
||||
@@ -28,7 +28,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/goplus/llgo/cl/blocks"
|
||||
"github.com/goplus/llgo/internal/packages"
|
||||
"github.com/goplus/llgo/internal/typepatch"
|
||||
llssa "github.com/goplus/llgo/ssa"
|
||||
"golang.org/x/tools/go/ssa"
|
||||
@@ -1022,9 +1021,6 @@ func NewPackageEx(prog llssa.Program, patches Patches, pkg *ssa.Package, files [
|
||||
pkg.Pkg = pkgTypes
|
||||
alt.Pkg = pkgTypes
|
||||
}
|
||||
if packages.DebugPackagesLoad {
|
||||
log.Println("==> NewPackageEx", pkgPath, hasPatch)
|
||||
}
|
||||
if pkgPath == llssa.PkgRuntime {
|
||||
prog.SetRuntime(pkgTypes)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user