Files
Memoh/internal/db/text_test.go
T
BBQ ca5c6a1866 refactor(core): restructure conversation, channel and message domains
- Rename chat module to conversation with flow-based architecture
- Move channelidentities into channel/identities subpackage
- Add channel/route for routing logic
- Add message service with event hub
- Add MCP providers: container, directory, schedule
- Refactor Feishu/Telegram adapters with directory and stream support
- Add platform management page and channel badges in web UI
- Update database schema for conversations, messages and channel routes
- Add @memoh/shared package for cross-package type definitions
2026-02-12 15:34:40 +08:00

27 lines
540 B
Go

package db
import (
"testing"
"github.com/jackc/pgx/v5/pgtype"
)
func TestTextToString(t *testing.T) {
tests := []struct {
name string
value pgtype.Text
want string
}{
{"valid", pgtype.Text{String: "hello", Valid: true}, "hello"},
{"invalid", pgtype.Text{}, ""},
{"valid empty", pgtype.Text{String: "", Valid: true}, ""},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := TextToString(tt.value); got != tt.want {
t.Errorf("TextToString() = %q, want %q", got, tt.want)
}
})
}
}