TestReplaceGoName

This commit is contained in:
xushiwei
2024-06-13 03:00:55 +08:00
parent 7235357ef5
commit b70b868552
3 changed files with 8 additions and 0 deletions

View File

@@ -207,6 +207,7 @@ Here are the Go packages that can be imported correctly:
* [unicode](https://pkg.go.dev/unicode)
* [unicode/utf8](https://pkg.go.dev/unicode/utf8)
* [unicode/utf16](https://pkg.go.dev/unicode/utf16)
* [math/bits](https://pkg.go.dev/math/bits)
## How to install

View File

@@ -6,4 +6,5 @@ import (
func main() {
println(bits.Len8(20))
println(bits.OnesCount(20))
}

View File

@@ -27,6 +27,12 @@ import (
"golang.org/x/tools/go/ssa"
)
func TestReplaceGoName(t *testing.T) {
if ret := replaceGoName("foo", 0); ret != "foo" {
t.Fatal("replaceGoName:", ret)
}
}
func TestIsAllocVargs(t *testing.T) {
if isAllocVargs(nil, ssaAlloc(&ssa.Return{})) {
t.Fatal("isVargs?")