@@ -158,6 +158,30 @@ mod tests {
158158 assert ! ( intents. contains( Intents :: DIRECT_MESSAGE_POLLS ) ) ;
159159 }
160160
161+ #[ test]
162+ fn parse_intents_is_case_insensitive_and_trimmed ( ) {
163+ let intents =
164+ parse_gateway_intents ( " GUILDS , Guild_Members , direct_message_reactions " ) . unwrap ( ) ;
165+ assert ! ( intents. contains( Intents :: GUILDS ) ) ;
166+ assert ! ( intents. contains( Intents :: GUILD_MEMBERS ) ) ;
167+ assert ! ( intents. contains( Intents :: DIRECT_MESSAGE_REACTIONS ) ) ;
168+ }
169+
170+ #[ test]
171+ fn parse_intents_union_of_individual_keywords_is_all ( ) {
172+ let intents = parse_gateway_intents (
173+ "guilds,guild_members,guild_moderation,guild_emojis_and_stickers,\
174+ guild_integrations,guild_webhooks,guild_invites,guild_voice_states,\
175+ guild_presences,guild_messages,guild_message_reactions,guild_message_typing,\
176+ direct_messages,direct_message_reactions,direct_message_typing,message_content,\
177+ guild_scheduled_events,auto_moderation_configuration,auto_moderation_execution,\
178+ guild_message_polls,direct_message_polls",
179+ )
180+ . unwrap ( ) ;
181+
182+ assert_eq ! ( intents, Intents :: all( ) ) ;
183+ }
184+
161185 #[ test]
162186 fn discord_bot_token_roundtrips ( ) {
163187 let token = DiscordBotToken :: new ( "Bot token" ) . unwrap ( ) ;
0 commit comments