mirror of
https://github.com/hanzozt/foundation.git
synced 2026-10-30 14:42:04 +00:00
* move util up a level * rename common to versions * remove pfxlog from versions * remove neatcat and echo server * move udp code to transport * remove agent, identity and metrics, which have been split out * remove config which was unused
28 lines
492 B
Go
28 lines
492 B
Go
package mirror
|
|
|
|
import (
|
|
"github.com/stretchr/testify/require"
|
|
"testing"
|
|
)
|
|
|
|
type testFieldStruct struct {
|
|
name string
|
|
subField *testFieldStruct
|
|
}
|
|
|
|
type testType struct {
|
|
Foo *testFieldStruct
|
|
}
|
|
|
|
func TestInitializeStructField(t *testing.T) {
|
|
testStruct := &testType{}
|
|
err := InitializeStructField(testStruct, "Foo")
|
|
|
|
req := require.New(t)
|
|
req.NoError(err)
|
|
req.NotNil(testStruct)
|
|
req.NotNil(testStruct.Foo)
|
|
req.Equal("", testStruct.Foo.name)
|
|
req.Nil(testStruct.Foo.subField)
|
|
}
|