Skip to content

Commit

Permalink
Update invite regex test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Nov 23, 2024
1 parent 6fbd823 commit 3550d32
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/pydis_core/utils/test_regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ def test_discord_invite_positives(self):
self.assertEqual(match_regex("www.discord.com/invite/python"), "python")
self.assertEqual(match_regex("discordapp.com/invite/python"), "python")
self.assertEqual(match_regex("discord.me/python"), "python")
self.assertEqual(match_regex("discord.li/python"), "python")
self.assertEqual(match_regex("discord.io/python"), "python")
self.assertEqual(match_regex(".gg/python"), "python")

self.assertEqual(match_regex("discord.gg/python/but/extra"), "python/but/extra")
Expand All @@ -56,9 +54,18 @@ def test_discord_invite_negatives(self):

self.assertEqual(match_regex("another string"), None)
self.assertEqual(match_regex("https://pythondiscord.com"), None)
self.assertEqual(match_regex("https://tenor.com/view/cat-scream-cat-rage-gif-8639900204413677493"), None)
self.assertEqual(match_regex("https://paste.pythondiscord.com/1234"), None)
self.assertEqual(match_regex("https://discord.com"), None)
self.assertEqual(match_regex("https://discord.gg"), None)
self.assertEqual(match_regex("https://discord.gg/ python"), None)
self.assertEqual(search_regex("https://discord.com/developers/applications"), None)
self.assertEqual(
search_regex(
"https://discord.com/channels/267624335836053506/305126844661760000/1309985927287930892"
), None
)

self.assertEqual(search_regex("https://discord.com with whitespace"), None)
self.assertEqual(search_regex(" https://discord.com "), None)
self.assertEqual(search_regex(" https://discord.com "), None)

0 comments on commit 3550d32

Please sign in to comment.