From a5ab2ba332e54ea07687775acc457d16566aa93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E6=BD=AE?= <2892931976@qq.com> Date: Sat, 15 Jun 2019 14:23:28 +0800 Subject: [PATCH 1/4] gutil test 2019 06 15 14:20 --- g/util/gutil/gutil_comparator_z_unit_test.go | 92 ++++++++++++++++++++ g/util/gutil/gutil_z_unit_test.go | 68 +++++++++++++++ 2 files changed, 160 insertions(+) create mode 100755 g/util/gutil/gutil_comparator_z_unit_test.go create mode 100755 g/util/gutil/gutil_z_unit_test.go diff --git a/g/util/gutil/gutil_comparator_z_unit_test.go b/g/util/gutil/gutil_comparator_z_unit_test.go new file mode 100755 index 000000000..5d8ed7a2e --- /dev/null +++ b/g/util/gutil/gutil_comparator_z_unit_test.go @@ -0,0 +1,92 @@ +package gutil_test + +import ( + "testing" + + "github.com/gogf/gf/g/test/gtest" + "github.com/gogf/gf/g/util/gutil" +) + +func Test_ComparatorString(t *testing.T) { + j := gutil.ComparatorString(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorInt(t *testing.T) { + j := gutil.ComparatorInt(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorInt8(t *testing.T) { + j := gutil.ComparatorInt8(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorInt16(t *testing.T) { + j := gutil.ComparatorInt16(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorInt32(t *testing.T) { + j := gutil.ComparatorInt32(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorInt64(t *testing.T) { + j := gutil.ComparatorInt64(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorUint(t *testing.T) { + j := gutil.ComparatorUint(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorUint8(t *testing.T) { + j := gutil.ComparatorUint8(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorUint16(t *testing.T) { + j := gutil.ComparatorUint16(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorUint32(t *testing.T) { + j := gutil.ComparatorUint32(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorUint64(t *testing.T) { + j := gutil.ComparatorUint64(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorFloat32(t *testing.T) { + j := gutil.ComparatorFloat32(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorFloat64(t *testing.T) { + j := gutil.ComparatorFloat64(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorByte(t *testing.T) { + j := gutil.ComparatorByte(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorRune(t *testing.T) { + j := gutil.ComparatorRune(1, 1) + gtest.Assert(j, 0) +} + +func Test_ComparatorTime(t *testing.T) { + j := gutil.ComparatorTime("2019-06-14", "2019-06-14") + gtest.Assert(j, 0) + k := gutil.ComparatorTime("2019-06-15", "2019-06-14") + gtest.Assert(k, 1) + l := gutil.ComparatorTime("2019-06-13", "2019-06-14") + gtest.Assert(l, -1) +} diff --git a/g/util/gutil/gutil_z_unit_test.go b/g/util/gutil/gutil_z_unit_test.go new file mode 100755 index 000000000..20b87fd8b --- /dev/null +++ b/g/util/gutil/gutil_z_unit_test.go @@ -0,0 +1,68 @@ +package gutil_test + +import ( + "testing" + + "github.com/gogf/gf/g/test/gtest" + "github.com/gogf/gf/g/util/gutil" +) + +func Test_Dump(t *testing.T) { + gtest.Case(t, func() { + gutil.Dump(map[int]int{ + 100: 100, + }) + gtest.Assert("", "") + }) + + gtest.Case(t, func() { + gutil.Dump(map[string]interface{}{"": func() {}}) + gtest.Assert("", "") + }) + + gtest.Case(t, func() { + gutil.Dump([]byte("gutil Dump test")) + gtest.Assert("", "") + }) +} + +func Test_PrintBacktrace(t *testing.T) { + gtest.Case(t, func() { + gutil.PrintBacktrace() + gtest.Assert("", "") + }) +} + +func Test_TryCatch(t *testing.T) { + + gutil.TryCatch(func() { + }, func(err interface{}) { + }) + gtest.Assert("", "") + + gutil.TryCatch(func() { + }) + gtest.Assert("", "") + + gutil.TryCatch(func() { + panic("gutil TryCatch test") + }, func(err interface{}) { + }) + gtest.Assert("", "") +} + +func Test_IsEmpty(t *testing.T) { + gtest.Assert(gutil.IsEmpty(1), false) +} + +func Test_Throw(t *testing.T) { + gtest.Case(t, func() { + defer func() { + if e := recover(); e != nil { + gtest.Assert(e, "gutil Throw test") + } + }() + + gutil.Throw("gutil Throw test") + }) +} From abe14e049a7afa9ea17dc8580c9051e7bd699661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E6=BD=AE?= <2892931976@qq.com> Date: Sun, 23 Jun 2019 16:45:30 +0800 Subject: [PATCH 2/4] gutil test 20190623 16:42 --- g/util/gutil/gutil_comparator_z_unit_test.go | 89 ++++++++++++++------ g/util/gutil/gutil_z_unit_test.go | 28 +++--- 2 files changed, 72 insertions(+), 45 deletions(-) diff --git a/g/util/gutil/gutil_comparator_z_unit_test.go b/g/util/gutil/gutil_comparator_z_unit_test.go index 5d8ed7a2e..fcdeba8b9 100755 --- a/g/util/gutil/gutil_comparator_z_unit_test.go +++ b/g/util/gutil/gutil_comparator_z_unit_test.go @@ -8,81 +8,114 @@ import ( ) func Test_ComparatorString(t *testing.T) { - j := gutil.ComparatorString(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorString(1, 1), 0) + gtest.Assert(gutil.ComparatorString(1, 2), -1) + gtest.Assert(gutil.ComparatorString(2, 1), 1) } func Test_ComparatorInt(t *testing.T) { - j := gutil.ComparatorInt(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorInt(1, 1), 0) + gtest.Assert(gutil.ComparatorInt(1, 2), -1) + gtest.Assert(gutil.ComparatorInt(2, 1), 1) } func Test_ComparatorInt8(t *testing.T) { - j := gutil.ComparatorInt8(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorInt8(1, 1), 0) + gtest.Assert(gutil.ComparatorInt8(1, 2), -1) + gtest.Assert(gutil.ComparatorInt8(2, 1), 1) } func Test_ComparatorInt16(t *testing.T) { - j := gutil.ComparatorInt16(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorInt16(1, 1), 0) + gtest.Assert(gutil.ComparatorInt16(1, 2), -1) + gtest.Assert(gutil.ComparatorInt16(2, 1), 1) } func Test_ComparatorInt32(t *testing.T) { - j := gutil.ComparatorInt32(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorInt32(1, 1), 0) + gtest.Assert(gutil.ComparatorInt32(1, 2), -1) + gtest.Assert(gutil.ComparatorInt32(2, 1), 1) } func Test_ComparatorInt64(t *testing.T) { - j := gutil.ComparatorInt64(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorInt64(1, 1), 0) + gtest.Assert(gutil.ComparatorInt64(1, 2), -1) + gtest.Assert(gutil.ComparatorInt64(2, 1), 1) } func Test_ComparatorUint(t *testing.T) { j := gutil.ComparatorUint(1, 1) gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorUint(1, 1), 0) + gtest.Assert(gutil.ComparatorUint(1, 2), -1) + gtest.Assert(gutil.ComparatorUint(2, 1), 1) } func Test_ComparatorUint8(t *testing.T) { - j := gutil.ComparatorUint8(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorUint8(1, 1), 0) + gtest.Assert(gutil.ComparatorUint8(1, 2), 255) + gtest.Assert(gutil.ComparatorUint8(2, 1), 1) } func Test_ComparatorUint16(t *testing.T) { - j := gutil.ComparatorUint16(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorUint16(1, 1), 0) + gtest.Assert(gutil.ComparatorUint16(1, 2), 65535) + gtest.Assert(gutil.ComparatorUint16(2, 1), 1) } func Test_ComparatorUint32(t *testing.T) { - j := gutil.ComparatorUint32(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorUint32(1, 1), 0) + gtest.Assert(gutil.ComparatorUint32(1, 2), 4294967295) + gtest.Assert(gutil.ComparatorUint32(2, 1), 1) } func Test_ComparatorUint64(t *testing.T) { - j := gutil.ComparatorUint64(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorUint64(1, 1), 0) + gtest.Assert(gutil.ComparatorUint64(1, 2), -1) + gtest.Assert(gutil.ComparatorUint64(2, 1), 1) } func Test_ComparatorFloat32(t *testing.T) { - j := gutil.ComparatorFloat32(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorFloat32(1, 1), 0) + gtest.Assert(gutil.ComparatorFloat32(1, 2), -1) + gtest.Assert(gutil.ComparatorFloat32(2, 1), 1) } func Test_ComparatorFloat64(t *testing.T) { - j := gutil.ComparatorFloat64(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorFloat64(1, 1), 0) + gtest.Assert(gutil.ComparatorFloat64(1, 2), -1) + gtest.Assert(gutil.ComparatorFloat64(2, 1), 1) } func Test_ComparatorByte(t *testing.T) { - j := gutil.ComparatorByte(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorByte(1, 1), 0) + gtest.Assert(gutil.ComparatorByte(1, 2), 255) + gtest.Assert(gutil.ComparatorByte(2, 1), 1) } func Test_ComparatorRune(t *testing.T) { - j := gutil.ComparatorRune(1, 1) - gtest.Assert(j, 0) + + gtest.Assert(gutil.ComparatorRune(1, 1), 0) + gtest.Assert(gutil.ComparatorRune(1, 2), -1) + gtest.Assert(gutil.ComparatorRune(2, 1), 1) } func Test_ComparatorTime(t *testing.T) { + j := gutil.ComparatorTime("2019-06-14", "2019-06-14") gtest.Assert(j, 0) k := gutil.ComparatorTime("2019-06-15", "2019-06-14") diff --git a/g/util/gutil/gutil_z_unit_test.go b/g/util/gutil/gutil_z_unit_test.go index 20b87fd8b..511605d18 100755 --- a/g/util/gutil/gutil_z_unit_test.go +++ b/g/util/gutil/gutil_z_unit_test.go @@ -12,43 +12,39 @@ func Test_Dump(t *testing.T) { gutil.Dump(map[int]int{ 100: 100, }) - gtest.Assert("", "") }) gtest.Case(t, func() { gutil.Dump(map[string]interface{}{"": func() {}}) - gtest.Assert("", "") }) gtest.Case(t, func() { gutil.Dump([]byte("gutil Dump test")) - gtest.Assert("", "") }) } func Test_PrintBacktrace(t *testing.T) { gtest.Case(t, func() { gutil.PrintBacktrace() - gtest.Assert("", "") }) } func Test_TryCatch(t *testing.T) { - gutil.TryCatch(func() { - }, func(err interface{}) { + gtest.Case(t, func() { + gutil.TryCatch(func() { + panic("gutil TryCatch test") + }) }) - gtest.Assert("", "") - gutil.TryCatch(func() { - }) - gtest.Assert("", "") + gtest.Case(t, func() { + gutil.TryCatch(func() { + panic("gutil TryCatch test") - gutil.TryCatch(func() { - panic("gutil TryCatch test") - }, func(err interface{}) { + }, func(err interface{}) { + gtest.Assert(err, "gutil TryCatch test") + }) }) - gtest.Assert("", "") } func Test_IsEmpty(t *testing.T) { @@ -58,9 +54,7 @@ func Test_IsEmpty(t *testing.T) { func Test_Throw(t *testing.T) { gtest.Case(t, func() { defer func() { - if e := recover(); e != nil { - gtest.Assert(e, "gutil Throw test") - } + gtest.Assert(recover(), "gutil Throw test") }() gutil.Throw("gutil Throw test") From 327e33b827e79b47be9ef1004495f745c970f396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E6=BD=AE?= <2892931976@qq.com> Date: Sun, 23 Jun 2019 20:44:03 +0800 Subject: [PATCH 3/4] gutil test 20190623 20:41 --- g/util/gutil/gutil_comparator_z_unit_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/g/util/gutil/gutil_comparator_z_unit_test.go b/g/util/gutil/gutil_comparator_z_unit_test.go index fcdeba8b9..6ec468eff 100755 --- a/g/util/gutil/gutil_comparator_z_unit_test.go +++ b/g/util/gutil/gutil_comparator_z_unit_test.go @@ -50,8 +50,6 @@ func Test_ComparatorInt64(t *testing.T) { } func Test_ComparatorUint(t *testing.T) { - j := gutil.ComparatorUint(1, 1) - gtest.Assert(j, 0) gtest.Assert(gutil.ComparatorUint(1, 1), 0) gtest.Assert(gutil.ComparatorUint(1, 2), -1) From 51cf2326911b44b1588c00ab781a7a476cdc075e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E6=BD=AE?= <2892931976@qq.com> Date: Tue, 25 Jun 2019 15:50:06 +0800 Subject: [PATCH 4/4] gutil test 20190615 15:47 --- g/util/gutil/gutil_comparator_z_unit_test.go | 135 ++++++++++++------- g/util/gutil/gutil_z_unit_test.go | 6 +- 2 files changed, 89 insertions(+), 52 deletions(-) diff --git a/g/util/gutil/gutil_comparator_z_unit_test.go b/g/util/gutil/gutil_comparator_z_unit_test.go index 6ec468eff..99c672190 100755 --- a/g/util/gutil/gutil_comparator_z_unit_test.go +++ b/g/util/gutil/gutil_comparator_z_unit_test.go @@ -9,115 +9,148 @@ import ( func Test_ComparatorString(t *testing.T) { - gtest.Assert(gutil.ComparatorString(1, 1), 0) - gtest.Assert(gutil.ComparatorString(1, 2), -1) - gtest.Assert(gutil.ComparatorString(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorString(1, 1), 0) + gtest.Assert(gutil.ComparatorString(1, 2), -1) + gtest.Assert(gutil.ComparatorString(2, 1), 1) + }) } func Test_ComparatorInt(t *testing.T) { - gtest.Assert(gutil.ComparatorInt(1, 1), 0) - gtest.Assert(gutil.ComparatorInt(1, 2), -1) - gtest.Assert(gutil.ComparatorInt(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorInt(1, 1), 0) + gtest.Assert(gutil.ComparatorInt(1, 2), -1) + gtest.Assert(gutil.ComparatorInt(2, 1), 1) + }) } func Test_ComparatorInt8(t *testing.T) { - gtest.Assert(gutil.ComparatorInt8(1, 1), 0) - gtest.Assert(gutil.ComparatorInt8(1, 2), -1) - gtest.Assert(gutil.ComparatorInt8(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorInt8(1, 1), 0) + gtest.Assert(gutil.ComparatorInt8(1, 2), -1) + gtest.Assert(gutil.ComparatorInt8(2, 1), 1) + }) } func Test_ComparatorInt16(t *testing.T) { - gtest.Assert(gutil.ComparatorInt16(1, 1), 0) - gtest.Assert(gutil.ComparatorInt16(1, 2), -1) - gtest.Assert(gutil.ComparatorInt16(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorInt16(1, 1), 0) + gtest.Assert(gutil.ComparatorInt16(1, 2), -1) + gtest.Assert(gutil.ComparatorInt16(2, 1), 1) + }) } func Test_ComparatorInt32(t *testing.T) { - gtest.Assert(gutil.ComparatorInt32(1, 1), 0) - gtest.Assert(gutil.ComparatorInt32(1, 2), -1) - gtest.Assert(gutil.ComparatorInt32(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorInt32(1, 1), 0) + gtest.Assert(gutil.ComparatorInt32(1, 2), -1) + gtest.Assert(gutil.ComparatorInt32(2, 1), 1) + }) } func Test_ComparatorInt64(t *testing.T) { - gtest.Assert(gutil.ComparatorInt64(1, 1), 0) - gtest.Assert(gutil.ComparatorInt64(1, 2), -1) - gtest.Assert(gutil.ComparatorInt64(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorInt64(1, 1), 0) + gtest.Assert(gutil.ComparatorInt64(1, 2), -1) + gtest.Assert(gutil.ComparatorInt64(2, 1), 1) + }) } func Test_ComparatorUint(t *testing.T) { - gtest.Assert(gutil.ComparatorUint(1, 1), 0) - gtest.Assert(gutil.ComparatorUint(1, 2), -1) - gtest.Assert(gutil.ComparatorUint(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorUint(1, 1), 0) + gtest.Assert(gutil.ComparatorUint(1, 2), -1) + gtest.Assert(gutil.ComparatorUint(2, 1), 1) + }) } func Test_ComparatorUint8(t *testing.T) { - gtest.Assert(gutil.ComparatorUint8(1, 1), 0) - gtest.Assert(gutil.ComparatorUint8(1, 2), 255) - gtest.Assert(gutil.ComparatorUint8(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorUint8(1, 1), 0) + gtest.Assert(gutil.ComparatorUint8(2, 6), 252) + gtest.Assert(gutil.ComparatorUint8(2, 1), 1) + }) } func Test_ComparatorUint16(t *testing.T) { - gtest.Assert(gutil.ComparatorUint16(1, 1), 0) - gtest.Assert(gutil.ComparatorUint16(1, 2), 65535) - gtest.Assert(gutil.ComparatorUint16(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorUint16(1, 1), 0) + gtest.Assert(gutil.ComparatorUint16(1, 2), 65535) + gtest.Assert(gutil.ComparatorUint16(2, 1), 1) + }) } func Test_ComparatorUint32(t *testing.T) { - gtest.Assert(gutil.ComparatorUint32(1, 1), 0) - gtest.Assert(gutil.ComparatorUint32(1, 2), 4294967295) - gtest.Assert(gutil.ComparatorUint32(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorUint32(1, 1), 0) + gtest.Assert(gutil.ComparatorUint32(-1000, 2147483640), 2147482656) + gtest.Assert(gutil.ComparatorUint32(2, 1), 1) + }) } func Test_ComparatorUint64(t *testing.T) { - gtest.Assert(gutil.ComparatorUint64(1, 1), 0) - gtest.Assert(gutil.ComparatorUint64(1, 2), -1) - gtest.Assert(gutil.ComparatorUint64(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorUint64(1, 1), 0) + gtest.Assert(gutil.ComparatorUint64(1, 2), -1) + gtest.Assert(gutil.ComparatorUint64(2, 1), 1) + }) } func Test_ComparatorFloat32(t *testing.T) { - gtest.Assert(gutil.ComparatorFloat32(1, 1), 0) - gtest.Assert(gutil.ComparatorFloat32(1, 2), -1) - gtest.Assert(gutil.ComparatorFloat32(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorFloat32(1, 1), 0) + gtest.Assert(gutil.ComparatorFloat32(1, 2), -1) + gtest.Assert(gutil.ComparatorFloat32(2, 1), 1) + }) } func Test_ComparatorFloat64(t *testing.T) { - gtest.Assert(gutil.ComparatorFloat64(1, 1), 0) - gtest.Assert(gutil.ComparatorFloat64(1, 2), -1) - gtest.Assert(gutil.ComparatorFloat64(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorFloat64(1, 1), 0) + gtest.Assert(gutil.ComparatorFloat64(1, 2), -1) + gtest.Assert(gutil.ComparatorFloat64(2, 1), 1) + }) } func Test_ComparatorByte(t *testing.T) { - gtest.Assert(gutil.ComparatorByte(1, 1), 0) - gtest.Assert(gutil.ComparatorByte(1, 2), 255) - gtest.Assert(gutil.ComparatorByte(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorByte(1, 1), 0) + gtest.Assert(gutil.ComparatorByte(1, 2), 255) + gtest.Assert(gutil.ComparatorByte(2, 1), 1) + }) } func Test_ComparatorRune(t *testing.T) { - gtest.Assert(gutil.ComparatorRune(1, 1), 0) - gtest.Assert(gutil.ComparatorRune(1, 2), -1) - gtest.Assert(gutil.ComparatorRune(2, 1), 1) + gtest.Case(t, func() { + gtest.Assert(gutil.ComparatorRune(1, 1), 0) + gtest.Assert(gutil.ComparatorRune(1, 2), -1) + gtest.Assert(gutil.ComparatorRune(2, 1), 1) + }) } func Test_ComparatorTime(t *testing.T) { + gtest.Case(t, func() { + j := gutil.ComparatorTime("2019-06-14", "2019-06-14") + gtest.Assert(j, 0) - j := gutil.ComparatorTime("2019-06-14", "2019-06-14") - gtest.Assert(j, 0) - k := gutil.ComparatorTime("2019-06-15", "2019-06-14") - gtest.Assert(k, 1) - l := gutil.ComparatorTime("2019-06-13", "2019-06-14") - gtest.Assert(l, -1) + k := gutil.ComparatorTime("2019-06-15", "2019-06-14") + gtest.Assert(k, 1) + + l := gutil.ComparatorTime("2019-06-13", "2019-06-14") + gtest.Assert(l, -1) + }) } diff --git a/g/util/gutil/gutil_z_unit_test.go b/g/util/gutil/gutil_z_unit_test.go index 511605d18..2c25edb47 100755 --- a/g/util/gutil/gutil_z_unit_test.go +++ b/g/util/gutil/gutil_z_unit_test.go @@ -48,10 +48,14 @@ func Test_TryCatch(t *testing.T) { } func Test_IsEmpty(t *testing.T) { - gtest.Assert(gutil.IsEmpty(1), false) + + gtest.Case(t, func() { + gtest.Assert(gutil.IsEmpty(1), false) + }) } func Test_Throw(t *testing.T) { + gtest.Case(t, func() { defer func() { gtest.Assert(recover(), "gutil Throw test")