mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
v2 -> v3
This commit is contained in:
@ -13,8 +13,8 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/ghash"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v3/encoding/ghash"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
)
|
||||
|
||||
// BinVersion returns the version of current running binary.
|
||||
|
||||
@ -12,10 +12,10 @@ import (
|
||||
|
||||
func Test_getPackageFromCallerFunction(t *testing.T) {
|
||||
dataMap := map[string]string{
|
||||
"github.com/gogf/gf/v2/test/a": "github.com/gogf/gf/v2/test/a",
|
||||
"github.com/gogf/gf/v2/test/a.C": "github.com/gogf/gf/v2/test/a",
|
||||
"github.com/gogf/gf/v2/test/aa.C": "github.com/gogf/gf/v2/test/aa",
|
||||
"github.com/gogf/gf/v2/test/gtest.C": "github.com/gogf/gf/v2/test/gtest",
|
||||
"github.com/gogf/gf/v3/test/a": "github.com/gogf/gf/v3/test/a",
|
||||
"github.com/gogf/gf/v3/test/a.C": "github.com/gogf/gf/v3/test/a",
|
||||
"github.com/gogf/gf/v3/test/aa.C": "github.com/gogf/gf/v3/test/aa",
|
||||
"github.com/gogf/gf/v3/test/gtest.C": "github.com/gogf/gf/v3/test/gtest",
|
||||
}
|
||||
for functionName, packageName := range dataMap {
|
||||
if result := getPackageFromCallerFunction(functionName); result != packageName {
|
||||
|
||||
@ -10,14 +10,14 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/debug/gdebug"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/debug/gdebug"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
func Test_CallerPackage(t *testing.T) {
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
t.Assert(gdebug.CallerPackage(), "github.com/gogf/gf/v2/test/gtest")
|
||||
t.Assert(gdebug.CallerPackage(), "github.com/gogf/gf/v3/test/gtest")
|
||||
})
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ func Test_CallerFileLineShort(t *testing.T) {
|
||||
|
||||
func Test_FuncPath(t *testing.T) {
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
t.Assert(gdebug.FuncPath(Test_FuncPath), "github.com/gogf/gf/v2/debug/gdebug_test.Test_FuncPath")
|
||||
t.Assert(gdebug.FuncPath(Test_FuncPath), "github.com/gogf/gf/v3/debug/gdebug_test.Test_FuncPath")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user