TestReplaceGoName
This commit is contained in:
@@ -207,6 +207,7 @@ Here are the Go packages that can be imported correctly:
|
|||||||
* [unicode](https://pkg.go.dev/unicode)
|
* [unicode](https://pkg.go.dev/unicode)
|
||||||
* [unicode/utf8](https://pkg.go.dev/unicode/utf8)
|
* [unicode/utf8](https://pkg.go.dev/unicode/utf8)
|
||||||
* [unicode/utf16](https://pkg.go.dev/unicode/utf16)
|
* [unicode/utf16](https://pkg.go.dev/unicode/utf16)
|
||||||
|
* [math/bits](https://pkg.go.dev/math/bits)
|
||||||
|
|
||||||
|
|
||||||
## How to install
|
## How to install
|
||||||
|
|||||||
@@ -6,4 +6,5 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
println(bits.Len8(20))
|
println(bits.Len8(20))
|
||||||
|
println(bits.OnesCount(20))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ import (
|
|||||||
"golang.org/x/tools/go/ssa"
|
"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) {
|
func TestIsAllocVargs(t *testing.T) {
|
||||||
if isAllocVargs(nil, ssaAlloc(&ssa.Return{})) {
|
if isAllocVargs(nil, ssaAlloc(&ssa.Return{})) {
|
||||||
t.Fatal("isVargs?")
|
t.Fatal("isVargs?")
|
||||||
|
|||||||
Reference in New Issue
Block a user