snapshot of https://github.com/ThreeDotsLabs/watermill.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
master / ci (push) Failing after 0s

This commit is contained in:
upstream-mirror
2026-09-15 21:27:46 +05:00
commit ce933d1277
538 changed files with 46504 additions and 0 deletions

47
internal/name_test.go Normal file
View File

@@ -0,0 +1,47 @@
package internal_test
import (
"testing"
"github.com/ThreeDotsLabs/watermill/internal"
"github.com/stretchr/testify/assert"
)
type testStruct struct{}
type stringerStruct struct{}
func (stringerStruct) String() string {
return "stringer"
}
func TestStructName(t *testing.T) {
testCases := []struct {
Name string
Struct interface{}
ExpectedName string
}{
{
Name: "simple_struct",
Struct: testStruct{},
ExpectedName: "internal_test.testStruct",
},
{
Name: "pointer_struct",
Struct: &testStruct{},
ExpectedName: "internal_test.testStruct",
},
{
Name: "stringer",
Struct: stringerStruct{},
ExpectedName: "stringer",
},
}
for _, c := range testCases {
t.Run(c.Name, func(t *testing.T) {
s := internal.StructName(c.Struct)
assert.Equal(t, c.ExpectedName, s)
})
}
}