diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bot/exts/utils/test_snekbox.py | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/tests/bot/exts/utils/test_snekbox.py b/tests/bot/exts/utils/test_snekbox.py index 6601fad2c..9a42d0610 100644 --- a/tests/bot/exts/utils/test_snekbox.py +++ b/tests/bot/exts/utils/test_snekbox.py @@ -52,6 +52,13 @@ class SnekboxTests(unittest.IsolatedAsyncioTestCase):              ('`print("Hello world!")`', 'print("Hello world!")', 'one line code block'),              ('```\nprint("Hello world!")```', 'print("Hello world!")', 'multiline code block'),              ('```py\nprint("Hello world!")```', 'print("Hello world!")', 'multiline python code block'), +            ('text```print("Hello world!")```text', 'print("Hello world!")', 'code block surrounded by text'), +            ('```print("Hello world!")```\ntext\n```py\nprint("Hello world!")```', +             'print("Hello world!")\nprint("Hello world!")', 'two code blocks with text in-between'), +            ('`print("Hello world!")`\ntext\n```print("How\'s it going?")```', +             'print("How\'s it going?")', 'code block preceded by inline code'), +            ('`print("Hello world!")`\ntext\n`print("Hello world!")`', +             'print("Hello world!")', 'one inline code block of two')          )          for case, expected, testname in cases:              with self.subTest(msg=f'Extract code from {testname}.'): | 
