Files
mautrix-telegram/pkg/gotd/tdp/tdp_test.go
T
2025-06-27 20:03:37 -07:00

50 lines
898 B
Go

package tdp_test
import (
"testing"
"github.com/stretchr/testify/require"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp/internal/schema"
)
func TestFormat(t *testing.T) {
for _, tt := range []struct {
Input tdp.Object
Output string
Options []tdp.Option
}{
{
Output: "<nil>",
},
{
Input: &schema.DCOption{
ID: 10,
IPAddress: "127.0.0.1",
Port: 1010,
},
Options: []tdp.Option{tdp.WithTypeID},
Output: "dcOption#18b7a10d",
},
{
Input: &schema.Config{
DCOptions: []schema.DCOption{
{
ID: 1,
IPAddress: "127.0.0.1",
Port: 1010,
},
},
},
Options: []tdp.Option{tdp.WithTypeID},
},
} {
t.Skip("TODO: Use golden files")
t.Run(tt.Output, func(t *testing.T) {
require.Equal(t, tt.Output, tdp.Format(tt.Input, tt.Options...))
})
}
}