package telegohandler

import (
	"context"
	"regexp"
	"testing"

	"github.com/stretchr/testify/assert"

	"github.com/mymmrac/telego"
)

const (
	testText        = `Test text`
	testTextLower   = `test text`
	testTextPart    = `t te`
	testTextPrefix  = `Test`
	testTextSuffix  = `text`
	testCommand1    = `/test abc 123`
	testCommand2    = `/hmm bcd`
	testCommand3    = "/test@test_bot abc 123"
	testCommandName = `test`
	testBotUsername = "test_bot"
)

func TestPredicates(t *testing.T) {
	tests := []struct {
		name      string
		predicate Predicate
		update    telego.Update
		matches   bool
	}{
		{
			name:      "any_matches",
			predicate: Any(),
			update:    telego.Update{},
			matches:   true,
		},
		{
			name:      "none_not_matches",
			predicate: None(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name: "and_matches",
			predicate: And(
				func(_ context.Context, _ telego.Update) bool { return true },
				func(_ context.Context, _ telego.Update) bool { return true },
			),
			update:  telego.Update{},
			matches: true,
		},
		{
			name: "and_not_matches",
			predicate: And(
				func(_ context.Context, _ telego.Update) bool { return true },
				func(_ context.Context, _ telego.Update) bool { return false },
			),
			update:  telego.Update{},
			matches: false,
		},
		{
			name: "or_matches",
			predicate: Or(
				func(_ context.Context, _ telego.Update) bool { return true },
				func(_ context.Context, _ telego.Update) bool { return false },
			),
			update:  telego.Update{},
			matches: true,
		},
		{
			name: "or_not_matches",
			predicate: Or(
				func(_ context.Context, _ telego.Update) bool { return false },
				func(_ context.Context, _ telego.Update) bool { return false },
			),
			update:  telego.Update{},
			matches: false,
		},
		{
			name:      "not_matches",
			predicate: Not(func(_ context.Context, _ telego.Update) bool { return false }),
			update:    telego.Update{},
			matches:   true,
		},
		{
			name:      "not_not_matches",
			predicate: Not(func(_ context.Context, _ telego.Update) bool { return true }),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_message_matches",
			predicate: AnyMessage(),
			update:    telego.Update{Message: &telego.Message{}},
			matches:   true,
		},
		{
			name:      "any_message_not_matches",
			predicate: AnyMessage(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_message_with_text_matches",
			predicate: AnyMessageWithText(),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "any_message_with_text_not_matches",
			predicate: AnyMessageWithText(),
			update:    telego.Update{Message: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "any_message_with_from_matches",
			predicate: AnyMessageWithFrom(),
			update:    telego.Update{Message: &telego.Message{From: &telego.User{}}},
			matches:   true,
		},
		{
			name:      "any_message_with_from_not_matches",
			predicate: AnyMessageWithFrom(),
			update:    telego.Update{Message: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "any_message_with_media_matches",
			predicate: AnyMessageWithMedia(),
			update:    telego.Update{Message: &telego.Message{Photo: []telego.PhotoSize{{}}}},
			matches:   true,
		},
		{
			name:      "any_message_with_media_not_matches",
			predicate: AnyMessageWithMedia(),
			update:    telego.Update{Message: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "text_equal_matches",
			predicate: TextEqual(testText),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "text_equal_not_matches",
			predicate: TextEqual(testText),
			update:    telego.Update{Message: &telego.Message{Text: testTextLower}},
			matches:   false,
		},
		{
			name:      "text_equal_fold_matches",
			predicate: TextEqualFold(testText),
			update:    telego.Update{Message: &telego.Message{Text: testTextLower}},
			matches:   true,
		},
		{
			name:      "text_equal_fold_not_matches",
			predicate: TextEqualFold(testText),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "text_contains_matches",
			predicate: TextContains(testTextPart),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "text_contains_not_matches",
			predicate: TextContains(testTextPart),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "text_prefix_matches",
			predicate: TextPrefix(testTextPrefix),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "text_prefix_not_matches",
			predicate: TextPrefix(testTextPrefix),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "text_suffix_matches",
			predicate: TextSuffix(testTextSuffix),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "text_suffix_not_matches",
			predicate: TextSuffix(testTextSuffix),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "text_matches_matches",
			predicate: TextMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "text_matches_not_matches",
			predicate: TextMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "any_command_matches",
			predicate: AnyCommand(),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   true,
		},
		{
			name:      "any_command_not_matches",
			predicate: AnyCommand(),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   false,
		},
		{
			name:      "any_command_to_me_matches",
			predicate: AnyCommandToMe(testBotUsername),
			update:    telego.Update{Message: &telego.Message{Text: testCommand3}},
			matches:   true,
		},
		{
			name:      "any_command_to_me_not_matches_no_username",
			predicate: AnyCommandToMe(testBotUsername),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "any_command_to_me_not_matches_no_message",
			predicate: AnyCommandToMe(testBotUsername),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_command_to_me_not_matches_no_command",
			predicate: AnyCommandToMe(testBotUsername),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   false,
		},
		{
			name:      "command_equal_matches",
			predicate: CommandEqual(testCommandName),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   true,
		},
		{
			name:      "command_equal_not_matches",
			predicate: CommandEqual(testCommandName),
			update:    telego.Update{Message: &telego.Message{Text: testCommand2}},
			matches:   false,
		},
		{
			name:      "command_equal_no_message",
			predicate: CommandEqual(testCommandName),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "command_equal_no_command",
			predicate: CommandEqual(testCommandName),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   false,
		},
		{
			name:      "command_equal_argc_matches",
			predicate: CommandEqualArgc(testCommandName, 2),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   true,
		},
		{
			name:      "command_equal_argc_not_matches",
			predicate: CommandEqualArgc(testCommandName, 3),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "command_equal_argc_no_message",
			predicate: CommandEqualArgc(testCommandName, 0),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "command_equal_argc_no_command",
			predicate: CommandEqualArgc(testCommandName, 0),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   false,
		},
		{
			name:      "command_equal_argv_matches",
			predicate: CommandEqualArgv(testCommandName, "abc", "123"),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   true,
		},
		{
			name:      "command_equal_argv_not_matches",
			predicate: CommandEqualArgv(testCommandName, "abc", "abc"),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "command_equal_argv_no_message",
			predicate: CommandEqualArgv(testCommandName),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "command_equal_argv_no_command",
			predicate: CommandEqualArgv(testCommandName),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   false,
		},
		{
			name:      "command_prefix_matches",
			predicate: CommandPrefix("Tes"),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   true,
		},
		{
			name:      "command_prefix_not_matches",
			predicate: CommandPrefix("Tes"),
			update:    telego.Update{Message: &telego.Message{Text: testCommand2}},
			matches:   false,
		},
		{
			name:      "command_prefix_no_message",
			predicate: CommandPrefix(testCommandName),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "command_prefix_no_command",
			predicate: CommandPrefix(testCommandName),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   false,
		},
		{
			name:      "command_suffix_matches",
			predicate: CommandSuffix("eSt"),
			update:    telego.Update{Message: &telego.Message{Text: testCommand1}},
			matches:   true,
		},
		{
			name:      "command_suffix_not_matches",
			predicate: CommandSuffix("eSt"),
			update:    telego.Update{Message: &telego.Message{Text: testCommand2}},
			matches:   false,
		},
		{
			name:      "command_suffix_no_message",
			predicate: CommandSuffix(testCommandName),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "command_suffix_no_command",
			predicate: CommandSuffix(testCommandName),
			update:    telego.Update{Message: &telego.Message{Text: testText}},
			matches:   false,
		},
		{
			name:      "success_payment_matches",
			predicate: SuccessPayment(),
			update:    telego.Update{Message: &telego.Message{SuccessfulPayment: &telego.SuccessfulPayment{}}},
			matches:   true,
		},
		{
			name:      "success_payment_not_matches",
			predicate: SuccessPayment(),
			update:    telego.Update{Message: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "any_edited_message_matches",
			predicate: AnyEditedMessage(),
			update:    telego.Update{EditedMessage: &telego.Message{}},
			matches:   true,
		},
		{
			name:      "any_edited_message_not_matches",
			predicate: AnyEditedMessage(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_edited_message_with_text_matches",
			predicate: AnyEditedMessageWithText(),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "any_edited_message_with_text_not_matches",
			predicate: AnyEditedMessageWithText(),
			update:    telego.Update{EditedMessage: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "any_edited_message_with_from_matches",
			predicate: AnyEditedMessageWithFrom(),
			update:    telego.Update{EditedMessage: &telego.Message{From: &telego.User{}}},
			matches:   true,
		},
		{
			name:      "any_edited_message_with_from_not_matches",
			predicate: AnyEditedMessageWithFrom(),
			update:    telego.Update{EditedMessage: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "edited_text_equal_matches",
			predicate: EditedTextEqual(testText),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "edited_text_equal_not_matches",
			predicate: EditedTextEqual(testText),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testTextLower}},
			matches:   false,
		},
		{
			name:      "edited_text_equal_fold_matches",
			predicate: EditedTextEqualFold(testText),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testTextLower}},
			matches:   true,
		},
		{
			name:      "edited_text_equal_fold_not_matches",
			predicate: EditedTextEqualFold(testText),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_text_contains_matches",
			predicate: EditedTextContains(testTextPart),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "edited_text_contains_not_matches",
			predicate: EditedTextContains(testTextPart),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_text_prefix_matches",
			predicate: EditedTextPrefix(testTextPrefix),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "edited_text_prefix_not_matches",
			predicate: EditedTextPrefix(testTextPrefix),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_text_suffix_matches",
			predicate: EditedTextSuffix(testTextSuffix),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "edited_text_suffix_not_matches",
			predicate: EditedTextSuffix(testTextSuffix),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_text_matches_matches",
			predicate: EditedTextMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "edited_text_matches_not_matches",
			predicate: EditedTextMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{EditedMessage: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "any_channel_post_matches",
			predicate: AnyChannelPost(),
			update:    telego.Update{ChannelPost: &telego.Message{}},
			matches:   true,
		},
		{
			name:      "any_channel_post_not_matches",
			predicate: AnyChannelPost(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_channel_post_with_text_matches",
			predicate: AnyChannelPostWithText(),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "any_channel_post_with_text_not_matches",
			predicate: AnyChannelPostWithText(),
			update:    telego.Update{ChannelPost: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "post_text_equal_matches",
			predicate: PostTextEqual(testText),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "post_text_equal_not_matches",
			predicate: PostTextEqual(testText),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testTextLower}},
			matches:   false,
		},
		{
			name:      "post_text_equal_fold_matches",
			predicate: PostTextEqualFold(testText),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testTextLower}},
			matches:   true,
		},
		{
			name:      "post_text_equal_fold_not_matches",
			predicate: PostTextEqualFold(testText),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "post_text_contains_matches",
			predicate: PostTextContains(testTextPart),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "post_text_contains_not_matches",
			predicate: PostTextContains(testTextPart),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "post_text_prefix_matches",
			predicate: PostTextPrefix(testTextPrefix),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "post_text_prefix_not_matches",
			predicate: PostTextPrefix(testTextPrefix),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "post_text_suffix_matches",
			predicate: PostTextSuffix(testTextSuffix),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "post_text_suffix_not_matches",
			predicate: PostTextSuffix(testTextSuffix),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "post_text_matches_matches",
			predicate: PostTextMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "post_text_matches_not_matches",
			predicate: PostTextMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{ChannelPost: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "any_edited_channel_post_matches",
			predicate: AnyEditedChannelPost(),
			update:    telego.Update{EditedChannelPost: &telego.Message{}},
			matches:   true,
		},
		{
			name:      "any_edited_channel_post_not_matches",
			predicate: AnyEditedChannelPost(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_edited_channel_post_with_text_matches",
			predicate: AnyEditedChannelPostWithText(),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "any_edited_channel_post_with_text_not_matches",
			predicate: AnyEditedChannelPostWithText(),
			update:    telego.Update{EditedChannelPost: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "edited_post_text_equal_matches",
			predicate: EditedPostTextEqual(testText),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "edited_post_text_equal_not_matches",
			predicate: EditedPostTextEqual(testText),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testTextLower}},
			matches:   false,
		},
		{
			name:      "edited_post_text_equal_fold_matches",
			predicate: EditedPostTextEqualFold(testText),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testTextLower}},
			matches:   true,
		},
		{
			name:      "edited_post_text_equal_fold_not_matches",
			predicate: EditedPostTextEqualFold(testText),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_post_text_contains_matches",
			predicate: EditedPostTextContains(testTextPart),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "edited_post_text_contains_not_matches",
			predicate: EditedPostTextContains(testTextPart),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_post_text_prefix_matches",
			predicate: EditedPostTextPrefix(testTextPrefix),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "edited_post_text_prefix_not_matches",
			predicate: EditedPostTextPrefix(testTextPrefix),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_post_text_suffix_matches",
			predicate: EditedPostTextSuffix(testTextSuffix),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "edited_post_text_suffix_not_matches",
			predicate: EditedPostTextSuffix(testTextSuffix),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_post_text_matches_matches",
			predicate: EditedPostTextMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testText}},
			matches:   true,
		},
		{
			name:      "edited_post_text_matches_not_matches",
			predicate: EditedPostTextMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{EditedChannelPost: &telego.Message{Text: testCommand1}},
			matches:   false,
		},
		{
			name:      "any_business_connection_matches",
			predicate: AnyBusinessConnection(),
			update:    telego.Update{BusinessConnection: &telego.BusinessConnection{}},
			matches:   true,
		},
		{
			name:      "any_business_connection_not_matches",
			predicate: AnyBusinessConnection(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_business_message_matches",
			predicate: AnyBusinessMessage(),
			update:    telego.Update{BusinessMessage: &telego.Message{}},
			matches:   true,
		},
		{
			name:      "any_business_message_not_matches",
			predicate: AnyBusinessMessage(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_edited_business_message_matches",
			predicate: AnyEditedBusinessMessage(),
			update:    telego.Update{EditedBusinessMessage: &telego.Message{}},
			matches:   true,
		},
		{
			name:      "any_edited_business_message_not_matches",
			predicate: AnyEditedBusinessMessage(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_deleted_business_messages_matches",
			predicate: AnyDeletedBusinessMessages(),
			update:    telego.Update{DeletedBusinessMessages: &telego.BusinessMessagesDeleted{}},
			matches:   true,
		},
		{
			name:      "any_deleted_business_messages_not_matches",
			predicate: AnyDeletedBusinessMessages(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_message_reaction_matches",
			predicate: AnyMessageReaction(),
			update:    telego.Update{MessageReaction: &telego.MessageReactionUpdated{}},
			matches:   true,
		},
		{
			name:      "any_message_reaction_not_matches",
			predicate: AnyMessageReaction(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_message_reaction_count_matches",
			predicate: AnyMessageReactionCount(),
			update:    telego.Update{MessageReactionCount: &telego.MessageReactionCountUpdated{}},
			matches:   true,
		},
		{
			name:      "any_message_reaction_count_not_matches",
			predicate: AnyMessageReactionCount(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_inline_query_matches",
			predicate: AnyInlineQuery(),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{}},
			matches:   true,
		},
		{
			name:      "any_inline_query_not_matches",
			predicate: AnyInlineQuery(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "inline_query_equal_matches",
			predicate: InlineQueryEqual(testText),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testText}},
			matches:   true,
		},
		{
			name:      "inline_query_equal_not_matches",
			predicate: InlineQueryEqual(testText),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testTextLower}},
			matches:   false,
		},
		{
			name:      "inline_query_equal_fold_matches",
			predicate: InlineQueryEqualFold(testText),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testTextLower}},
			matches:   true,
		},
		{
			name:      "inline_query_equal_fold_not_matches",
			predicate: InlineQueryEqualFold(testText),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testCommand1}},
			matches:   false,
		},
		{
			name:      "inline_query_contains_matches",
			predicate: InlineQueryContains(testTextPart),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testText}},
			matches:   true,
		},
		{
			name:      "inline_query_contains_not_matches",
			predicate: InlineQueryContains(testTextPart),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testCommand1}},
			matches:   false,
		},
		{
			name:      "inline_query_prefix_matches",
			predicate: InlineQueryPrefix(testTextPrefix),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testText}},
			matches:   true,
		},
		{
			name:      "inline_query_prefix_not_matches",
			predicate: InlineQueryPrefix(testTextPrefix),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testCommand1}},
			matches:   false,
		},
		{
			name:      "inline_query_suffix_matches",
			predicate: InlineQuerySuffix(testTextSuffix),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testText}},
			matches:   true,
		},
		{
			name:      "inline_query_suffix_not_matches",
			predicate: InlineQuerySuffix(testTextSuffix),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testCommand1}},
			matches:   false,
		},
		{
			name:      "inline_query_matches_matches",
			predicate: InlineQueryMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testText}},
			matches:   true,
		},
		{
			name:      "inline_query_matches_not_matches",
			predicate: InlineQueryMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{InlineQuery: &telego.InlineQuery{Query: testCommand1}},
			matches:   false,
		},
		{
			name:      "any_chosen_inline_result_matches",
			predicate: AnyChosenInlineResult(),
			update:    telego.Update{ChosenInlineResult: &telego.ChosenInlineResult{}},
			matches:   true,
		},
		{
			name:      "any_chosen_inline_result_not_matches",
			predicate: AnyChosenInlineResult(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_callback_query_matches",
			predicate: AnyCallbackQuery(),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{}},
			matches:   true,
		},
		{
			name:      "any_callback_query_not_matches",
			predicate: AnyCallbackQuery(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_callback_query_with_message_matches",
			predicate: AnyCallbackQueryWithMessage(),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Message: &telego.Message{}}},
			matches:   true,
		},
		{
			name:      "any_callback_query_with_message_not_matches",
			predicate: AnyCallbackQueryWithMessage(),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{}},
			matches:   false,
		},
		{
			name:      "callback_data_equal_matches",
			predicate: CallbackDataEqual(testText),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testText}},
			matches:   true,
		},
		{
			name:      "callback_data_equal_not_matches",
			predicate: CallbackDataEqual(testText),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testTextLower}},
			matches:   false,
		},
		{
			name:      "callback_data_equal_fold_matches",
			predicate: CallbackDataEqualFold(testText),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testTextLower}},
			matches:   true,
		},
		{
			name:      "callback_data_equal_fold_not_matches",
			predicate: CallbackDataEqualFold(testText),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testCommand1}},
			matches:   false,
		},
		{
			name:      "callback_data_contains_matches",
			predicate: CallbackDataContains(testTextPart),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testText}},
			matches:   true,
		},
		{
			name:      "callback_data_contains_not_matches",
			predicate: CallbackDataContains(testTextPart),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testCommand1}},
			matches:   false,
		},
		{
			name:      "callback_data_prefix_matches",
			predicate: CallbackDataPrefix(testTextPrefix),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testText}},
			matches:   true,
		},
		{
			name:      "callback_data_prefix_not_matches",
			predicate: CallbackDataPrefix(testTextPrefix),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testCommand1}},
			matches:   false,
		},
		{
			name:      "callback_data_suffix_matches",
			predicate: CallbackDataSuffix(testTextSuffix),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testText}},
			matches:   true,
		},
		{
			name:      "callback_data_suffix_not_matches",
			predicate: CallbackDataSuffix(testTextSuffix),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testCommand1}},
			matches:   false,
		},
		{
			name:      "callback_data_matches_matches",
			predicate: CallbackDataMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testText}},
			matches:   true,
		},
		{
			name:      "callback_data_matches_not_matches",
			predicate: CallbackDataMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{CallbackQuery: &telego.CallbackQuery{Data: testCommand1}},
			matches:   false,
		},
		{
			name:      "any_shipping_query_matches",
			predicate: AnyShippingQuery(),
			update:    telego.Update{ShippingQuery: &telego.ShippingQuery{}},
			matches:   true,
		},
		{
			name:      "any_shipping_query_not_matches",
			predicate: AnyShippingQuery(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_pre_checkout_query_matches",
			predicate: AnyPreCheckoutQuery(),
			update:    telego.Update{PreCheckoutQuery: &telego.PreCheckoutQuery{}},
			matches:   true,
		},
		{
			name:      "any_pre_checkout_query_not_matches",
			predicate: AnyPreCheckoutQuery(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_purchased_paid_media_matches",
			predicate: AnyPurchasedPaidMedia(),
			update:    telego.Update{PurchasedPaidMedia: &telego.PaidMediaPurchased{}},
			matches:   true,
		},
		{
			name:      "any_purchased_paid_media_not_matches",
			predicate: AnyPurchasedPaidMedia(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_poll_matches",
			predicate: AnyPoll(),
			update:    telego.Update{Poll: &telego.Poll{}},
			matches:   true,
		},
		{
			name:      "any_poll_not_matches",
			predicate: AnyPoll(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_poll_answer_matches",
			predicate: AnyPollAnswer(),
			update:    telego.Update{PollAnswer: &telego.PollAnswer{}},
			matches:   true,
		},
		{
			name:      "any_poll_answer_not_matches",
			predicate: AnyPollAnswer(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_my_chat_member_matches",
			predicate: AnyMyChatMember(),
			update:    telego.Update{MyChatMember: &telego.ChatMemberUpdated{}},
			matches:   true,
		},
		{
			name:      "any_my_chat_member_not_matches",
			predicate: AnyMyChatMember(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_chat_member_matches",
			predicate: AnyChatMember(),
			update:    telego.Update{ChatMember: &telego.ChatMemberUpdated{}},
			matches:   true,
		},
		{
			name:      "any_chat_member_not_matches",
			predicate: AnyChatMember(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_chat_join_request_matches",
			predicate: AnyChatJoinRequest(),
			update:    telego.Update{ChatJoinRequest: &telego.ChatJoinRequest{}},
			matches:   true,
		},
		{
			name:      "any_chat_join_request_not_matches",
			predicate: AnyChatJoinRequest(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_chat_boost_matches",
			predicate: AnyChatBoost(),
			update:    telego.Update{ChatBoost: &telego.ChatBoostUpdated{}},
			matches:   true,
		},
		{
			name:      "any_chat_boost_not_matches",
			predicate: AnyChatBoost(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_removed_chat_boost_matches",
			predicate: AnyRemovedChatBoost(),
			update:    telego.Update{RemovedChatBoost: &telego.ChatBoostRemoved{}},
			matches:   true,
		},
		{
			name:      "any_removed_chat_boost_not_matches",
			predicate: AnyRemovedChatBoost(),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "any_message_with_caption_matches",
			predicate: AnyMessageWithCaption(),
			update:    telego.Update{Message: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "any_message_with_caption_not_matches",
			predicate: AnyMessageWithCaption(),
			update:    telego.Update{Message: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "caption_equal_matches",
			predicate: CaptionEqual(testText),
			update:    telego.Update{Message: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "caption_equal_not_matches",
			predicate: CaptionEqual(testText),
			update:    telego.Update{Message: &telego.Message{Caption: testTextLower}},
			matches:   false,
		},
		{
			name:      "caption_equal_fold_matches",
			predicate: CaptionEqualFold(testText),
			update:    telego.Update{Message: &telego.Message{Caption: testTextLower}},
			matches:   true,
		},
		{
			name:      "caption_equal_fold_not_matches",
			predicate: CaptionEqualFold(testText),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "caption_contains_matches",
			predicate: CaptionContains(testTextPart),
			update:    telego.Update{Message: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "caption_contains_not_matches",
			predicate: CaptionContains(testTextPart),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "caption_prefix_matches",
			predicate: CaptionPrefix(testTextPrefix),
			update:    telego.Update{Message: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "caption_prefix_not_matches",
			predicate: CaptionPrefix(testTextPrefix),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "caption_suffix_matches",
			predicate: CaptionSuffix(testTextSuffix),
			update:    telego.Update{Message: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "caption_suffix_not_matches",
			predicate: CaptionSuffix(testTextSuffix),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "caption_matches_matches",
			predicate: CaptionMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{Message: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "caption_matches_not_matches",
			predicate: CaptionMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "any_caption_command_matches",
			predicate: AnyCaptionCommand(),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   true,
		},
		{
			name:      "any_caption_command_not_matches",
			predicate: AnyCaptionCommand(),
			update:    telego.Update{Message: &telego.Message{Caption: testText}},
			matches:   false,
		},
		{
			name:      "caption_command_equal_matches",
			predicate: CaptionCommandEqual(testCommandName),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   true,
		},
		{
			name:      "caption_command_equal_not_matches",
			predicate: CaptionCommandEqual(testCommandName),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand2}},
			matches:   false,
		},
		{
			name:      "caption_command_equal_no_message",
			predicate: CaptionCommandEqual(testCommandName),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "caption_command_equal_no_command",
			predicate: CaptionCommandEqual(testCommandName),
			update:    telego.Update{Message: &telego.Message{Caption: testText}},
			matches:   false,
		},
		{
			name:      "caption_command_equal_argc_matches",
			predicate: CaptionCommandEqualArgc(testCommandName, 2),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   true,
		},
		{
			name:      "caption_command_equal_argc_not_matches",
			predicate: CaptionCommandEqualArgc(testCommandName, 3),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "caption_command_equal_argc_no_message",
			predicate: CaptionCommandEqualArgc(testCommandName, 0),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "caption_command_equal_argc_no_command",
			predicate: CaptionCommandEqualArgc(testCommandName, 0),
			update:    telego.Update{Message: &telego.Message{Caption: testText}},
			matches:   false,
		},
		{
			name:      "caption_command_equal_argv_matches",
			predicate: CaptionCommandEqualArgv(testCommandName, "abc", "123"),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   true,
		},
		{
			name:      "caption_command_equal_argv_not_matches",
			predicate: CaptionCommandEqualArgv(testCommandName, "abc", "abc"),
			update:    telego.Update{Message: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "caption_command_equal_argv_no_message",
			predicate: CaptionCommandEqualArgv(testCommandName),
			update:    telego.Update{},
			matches:   false,
		},
		{
			name:      "caption_command_equal_argv_no_command",
			predicate: CaptionCommandEqualArgv(testCommandName),
			update:    telego.Update{Message: &telego.Message{Caption: testText}},
			matches:   false,
		},
		{
			name:      "any_edited_message_with_caption_matches",
			predicate: AnyEditedMessageWithCaption(),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "any_edited_message_with_caption_not_matches",
			predicate: AnyEditedMessageWithCaption(),
			update:    telego.Update{EditedMessage: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "edited_caption_equal_matches",
			predicate: EditedCaptionEqual(testText),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "edited_caption_equal_not_matches",
			predicate: EditedCaptionEqual(testText),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testTextLower}},
			matches:   false,
		},
		{
			name:      "edited_caption_equal_fold_matches",
			predicate: EditedCaptionEqualFold(testText),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testTextLower}},
			matches:   true,
		},
		{
			name:      "edited_caption_equal_fold_not_matches",
			predicate: EditedCaptionEqualFold(testText),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_caption_contains_matches",
			predicate: EditedCaptionContains(testTextPart),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "edited_caption_contains_not_matches",
			predicate: EditedCaptionContains(testTextPart),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_caption_prefix_matches",
			predicate: EditedCaptionPrefix(testTextPrefix),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "edited_caption_prefix_not_matches",
			predicate: EditedCaptionPrefix(testTextPrefix),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_caption_suffix_matches",
			predicate: EditedCaptionSuffix(testTextSuffix),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "edited_caption_suffix_not_matches",
			predicate: EditedCaptionSuffix(testTextSuffix),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_caption_matches_matches",
			predicate: EditedCaptionMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "edited_caption_matches_not_matches",
			predicate: EditedCaptionMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{EditedMessage: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "any_channel_post_with_caption_matches",
			predicate: AnyChannelPostWithCaption(),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "any_channel_post_with_caption_not_matches",
			predicate: AnyChannelPostWithCaption(),
			update:    telego.Update{ChannelPost: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "post_caption_equal_matches",
			predicate: PostCaptionEqual(testText),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "post_caption_equal_not_matches",
			predicate: PostCaptionEqual(testText),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testTextLower}},
			matches:   false,
		},
		{
			name:      "post_caption_equal_fold_matches",
			predicate: PostCaptionEqualFold(testText),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testTextLower}},
			matches:   true,
		},
		{
			name:      "post_caption_equal_fold_not_matches",
			predicate: PostCaptionEqualFold(testText),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "post_caption_contains_matches",
			predicate: PostCaptionContains(testTextPart),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "post_caption_contains_not_matches",
			predicate: PostCaptionContains(testTextPart),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "post_caption_prefix_matches",
			predicate: PostCaptionPrefix(testTextPrefix),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "post_caption_prefix_not_matches",
			predicate: PostCaptionPrefix(testTextPrefix),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "post_caption_suffix_matches",
			predicate: PostCaptionSuffix(testTextSuffix),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "post_caption_suffix_not_matches",
			predicate: PostCaptionSuffix(testTextSuffix),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "post_caption_matches_matches",
			predicate: PostCaptionMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "post_caption_matches_not_matches",
			predicate: PostCaptionMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{ChannelPost: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "any_edited_channel_post_with_caption_matches",
			predicate: AnyEditedChannelPostWithCaption(),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "any_edited_channel_post_with_caption_not_matches",
			predicate: AnyEditedChannelPostWithCaption(),
			update:    telego.Update{EditedChannelPost: &telego.Message{}},
			matches:   false,
		},
		{
			name:      "edited_post_caption_equal_matches",
			predicate: EditedPostCaptionEqual(testText),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "edited_post_caption_equal_not_matches",
			predicate: EditedPostCaptionEqual(testText),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testTextLower}},
			matches:   false,
		},
		{
			name:      "edited_post_caption_equal_fold_matches",
			predicate: EditedPostCaptionEqualFold(testText),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testTextLower}},
			matches:   true,
		},
		{
			name:      "edited_post_caption_equal_fold_not_matches",
			predicate: EditedPostCaptionEqualFold(testText),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_post_caption_contains_matches",
			predicate: EditedPostCaptionContains(testTextPart),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "edited_post_caption_contains_not_matches",
			predicate: EditedPostCaptionContains(testTextPart),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_post_caption_prefix_matches",
			predicate: EditedPostCaptionPrefix(testTextPrefix),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "edited_post_caption_prefix_not_matches",
			predicate: EditedPostCaptionPrefix(testTextPrefix),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_post_caption_suffix_matches",
			predicate: EditedPostCaptionSuffix(testTextSuffix),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "edited_post_caption_suffix_not_matches",
			predicate: EditedPostCaptionSuffix(testTextSuffix),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
		{
			name:      "edited_post_caption_matches_matches",
			predicate: EditedPostCaptionMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testText}},
			matches:   true,
		},
		{
			name:      "edited_post_caption_matches_not_matches",
			predicate: EditedPostCaptionMatches(regexp.MustCompile(`^\w+ \w+$`)),
			update:    telego.Update{EditedChannelPost: &telego.Message{Caption: testCommand1}},
			matches:   false,
		},
	}

	ctx := t.Context()
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			assert.Equal(t, tt.matches, tt.predicate(ctx, tt.update))
		})
	}
}
