mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-17 03:27:02 +08:00
26 lines
589 B
Go
26 lines
589 B
Go
package msg
|
|
|
|
import (
|
|
"testing"
|
|
"github.com/OpenIMSDK/Open-IM-Server/internal/logic/service"
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/pb"
|
|
)
|
|
|
|
func TestSearchMsg(t *testing.T) {
|
|
// Ensure that the database is empty
|
|
// clearDatabase()
|
|
|
|
// Call the SearchMsg function
|
|
req := &pb.SearchMsgReq{}
|
|
resp, err := service.NewMsgService().SearchMsg(context.Background(), req)
|
|
|
|
// Check that the error is nil and the response is empty
|
|
if err != nil {
|
|
t.Errorf("Expected nil error, got %v", err)
|
|
}
|
|
if resp != &pb.SearchMsgResp{} {
|
|
t.Errorf("Expected empty response, got %v", resp)
|
|
}
|
|
}
|
|
|