From 930fe159bffc22e15f462febcadf89ce7a4648ff Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Thu, 27 Jul 2023 18:26:21 +0800 Subject: [PATCH] test: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit super 包添加 Convert 函数的单元测试 --- utils/super/unsafe_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 utils/super/unsafe_test.go diff --git a/utils/super/unsafe_test.go b/utils/super/unsafe_test.go new file mode 100644 index 0000000..f504ffe --- /dev/null +++ b/utils/super/unsafe_test.go @@ -0,0 +1,18 @@ +package super_test + +import ( + "fmt" + "github.com/kercylan98/minotaur/utils/super" + "go.uber.org/atomic" + "testing" +) + +func TestConvert(t *testing.T) { + type B struct { + nocmp [0]func() + v atomic.Value + } + var a = atomic.NewString("hello") + var b = super.Convert[*atomic.String, *B](a) + fmt.Println(b.v.Load()) +}