TestCollectSkipNames

This commit is contained in:
xushiwei
2024-06-15 18:22:26 +08:00
parent 7f11651311
commit dcb8eb7d6d
2 changed files with 8 additions and 4 deletions

View File

@@ -52,11 +52,7 @@ jobs:
- name: Build
run: go build -v ./...
- name: Test
if: matrix.os != 'ubuntu-latest'
run: go test -v ./...
- name: Test with coverage
if: matrix.os == 'ubuntu-latest'
run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./...
- name: Install

View File

@@ -27,6 +27,11 @@ import (
"golang.org/x/tools/go/ssa"
)
func TestCollectSkipNames(t *testing.T) {
ctx := &context{skips: make(map[string]none)}
ctx.collectSkipNames("//llgo:skip abs")
}
func TestReplaceGoName(t *testing.T) {
if ret := replaceGoName("foo", 0); ret != "foo" {
t.Fatal("replaceGoName:", ret)
@@ -155,6 +160,9 @@ func TestPkgKind(t *testing.T) {
if v, _ := pkgKind("noinit"); v != PkgNoInit {
t.Fatal("pkgKind:", v)
}
if v, _ := pkgKind("link"); v != PkgLinkIR {
t.Fatal("pkgKind:", v)
}
if v, _ := pkgKind(""); v != PkgLLGo {
t.Fatal("pkgKind:", v)
}