TestErrImport

This commit is contained in:
xushiwei
2024-06-17 04:11:31 +08:00
parent 4097f90938
commit ebc9711309
2 changed files with 8 additions and 4 deletions

View File

@@ -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) {