From 7c1fdac24dcc2e75da1d4cfebc69618acb4039ba Mon Sep 17 00:00:00 2001 From: hsfish Date: Wed, 19 Feb 2025 19:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convert/interface_test.go | 47 --------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 convert/interface_test.go diff --git a/convert/interface_test.go b/convert/interface_test.go deleted file mode 100644 index 245ad095..00000000 --- a/convert/interface_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2021 The Xorm Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package convert - -import ( - "database/sql" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func TestInterface2Interface_RawBytesWithSameAddr(t *testing.T) { - - kases := []string{ - "testOneTwoThird", - "testTwo", - "testThird", - } - - targetResult := make(map[string]interface{}, len(kases)) - // sql.Rows nextLocked() used same addr []driver.Value - var rawBytes sql.RawBytes = make([]byte, 0, 1000) - sameRawBytes := &rawBytes - for _, val := range kases { - t.Run(val, func(t *testing.T) { - sameBytes := *sameRawBytes - sameBytes = sameBytes[:0] - for _, b := range []byte(val) { - sameBytes = append(sameBytes, b) - } - *sameRawBytes = sameBytes - - target, err := Interface2Interface(time.UTC, sameRawBytes) - assert.NoError(t, err) - targetResult[val] = target - }) - } - - for val, target := range targetResult { - t.Run(val, func(t *testing.T) { - assert.EqualValues(t, val, target) - }) - } -}