refactor: sync sparse tlprofile runtime
This commit is contained in:
parent
5ecf4e912d
commit
25ab04a254
93 changed files with 2983 additions and 1615 deletions
|
|
@ -16,6 +16,17 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
// dispatchCanonicalValue exposes the handler value behind tlprofile's exact
|
||||
// result encoder. Object/class results already arrive as concrete tg values;
|
||||
// primitive and Vector<T> method results remain attached to the exact result
|
||||
// plan because they are not bin.Object values.
|
||||
func dispatchCanonicalValue(encoded bin.Encoder) any {
|
||||
if result, ok := encoded.(interface{ CanonicalValue() any }); ok {
|
||||
return result.CanonicalValue()
|
||||
}
|
||||
return encoded
|
||||
}
|
||||
|
||||
type rpcChannelFixture struct {
|
||||
t *testing.T
|
||||
ctx context.Context
|
||||
|
|
@ -111,8 +122,6 @@ func searchMessagesPayload(t *testing.T, enc bin.Encoder) ([]tg.MessageClass, []
|
|||
return result.Messages, result.Chats, result.Users
|
||||
case *tg.MessagesChannelMessages:
|
||||
return result.Messages, result.Chats, result.Users
|
||||
case *tg.MessagesMessagesBox:
|
||||
return searchMessagesPayload(t, result.Messages)
|
||||
default:
|
||||
t.Fatalf("search result type = %T, want messages/messagesSlice", enc)
|
||||
return nil, nil, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue