TestToBackground

This commit is contained in:
xushiwei
2024-07-09 12:58:51 +08:00
parent e4ae0980b4
commit 3f344b55bb
2 changed files with 7 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ import (
q "github.com/goplus/llgo/cl/internal/qsort" q "github.com/goplus/llgo/cl/internal/qsort"
) )
// llgo:type C //llgo:type C
type Comp func(a, b c.Pointer) c.Int type Comp func(a, b c.Pointer) c.Int
//go:linkname qsort C.qsort //go:linkname qsort C.qsort

View File

@@ -27,6 +27,12 @@ import (
"golang.org/x/tools/go/ssa" "golang.org/x/tools/go/ssa"
) )
func TestToBackground(t *testing.T) {
if v := toBackground(""); v != llssa.InGo {
t.Fatal("toBackground:", v)
}
}
func TestCollectSkipNames(t *testing.T) { func TestCollectSkipNames(t *testing.T) {
ctx := &context{skips: make(map[string]none)} ctx := &context{skips: make(map[string]none)}
ctx.collectSkipNames("//llgo:skipall") ctx.collectSkipNames("//llgo:skipall")