From d77ee854d3bd560e68382f34fbf5b325aab7dfbc Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sun, 11 Feb 2024 01:03:38 +0800 Subject: [PATCH] TestYaptest: use Gopo_xxx to make it more friendly --- cl/compile_gop_test.go | 2 +- cl/internal/test/match.go | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/cl/compile_gop_test.go b/cl/compile_gop_test.go index 9ae129f16..8c1acbbf2 100644 --- a/cl/compile_gop_test.go +++ b/cl/compile_gop_test.go @@ -1178,7 +1178,7 @@ var c Class var a int func main() { - test.Gopt_Case_Match__1(c, a, "b") + test.Gopt_Case_MatchAny(c, a, "b") } `) } diff --git a/cl/internal/test/match.go b/cl/internal/test/match.go index 5504b0929..5cba93869 100644 --- a/cl/internal/test/match.go +++ b/cl/internal/test/match.go @@ -28,16 +28,12 @@ type Case struct { CaseT } -func Gopt_Case_Equal__0[T basetype](t CaseT, a, b T) bool { - return a == b -} - -func Gopt_Case_Equal__1(t CaseT, a, b any) bool { - return true -} +const ( + Gopo_Gopt_Case_Match = "Gopt_Case_MatchTBase,Gopt_Case_MatchAny" +) -func Gopt_Case_Match__0[T basetype](t CaseT, got, expected T, name ...string) { +func Gopt_Case_MatchTBase[T basetype](t CaseT, got, expected T, name ...string) { } -func Gopt_Case_Match__1(t CaseT, got, expected any, name ...string) { +func Gopt_Case_MatchAny(t CaseT, got, expected any, name ...string) { }