From f09d5bd155fcb8de6bcbbc686665be70930ce151 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sun, 28 Apr 2024 22:38:04 +0800 Subject: [PATCH] TestIsAny, TestIntVal --- cl/builtin_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cl/builtin_test.go b/cl/builtin_test.go index 1d116134..8eabda7c 100644 --- a/cl/builtin_test.go +++ b/cl/builtin_test.go @@ -24,6 +24,21 @@ import ( "golang.org/x/tools/go/ssa" ) +func TestIsAny(t *testing.T) { + if isAny(types.Typ[types.UntypedInt]) { + t.Fatal("isAny?") + } +} + +func TestIntVal(t *testing.T) { + defer func() { + if r := recover(); r == nil { + t.Fatal("intVal: no error?") + } + }() + intVal(&ssa.Parameter{}) +} + func TestIgnoreName(t *testing.T) { if !ignoreName("runtime.foo") || !ignoreName("runtime/foo") || !ignoreName("internal/abi") { t.Fatal("ignoreName failed")