diff options
| author | SavagePeanut <sourcehut@lazytapir.com> | 2023-09-08 11:50:13 -0500 |
|---|---|---|
| committer | SavagePeanut <sourcehut@lazytapir.com> | 2023-09-08 11:51:54 -0500 |
| commit | 7c73544dac2c1d5b21e201469a0c9c6d0a654f0b (patch) | |
| tree | 2b8c584327689c4d8e7ddc17edda3cafb5b4b384 /tests | |
| parent | 35884c910a190237abfbab40a536b2d14f826f92 (diff) | |
fix telegram styles
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_telegram.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/test_telegram.py b/tests/test_telegram.py index 1fbbb8d..0b3dbdc 100644 --- a/tests/test_telegram.py +++ b/tests/test_telegram.py @@ -3,22 +3,22 @@ from slidge_style_parser import format_for_telegram def test_basic(): test = "_underline_" formatted_body = "underline" - styles = [('italics', 1, 8, '')] + styles = [('italics', 0, 9, '')] assert(format_for_telegram(test) == (formatted_body, styles)) test = "*bold*" formatted_body = "bold" - styles = [('bold', 1, 3, '')] + styles = [('bold', 0, 4, '')] assert(format_for_telegram(test) == (formatted_body, styles)) test = "~strikethrough~" formatted_body = "strikethrough" - styles = [('strikethrough', 1, 12, '')] + styles = [('strikethrough', 0, 13, '')] assert(format_for_telegram(test) == (formatted_body, styles)) test = "`code span`" formatted_body = "code span" - styles = [('code', 1, 8, '')] + styles = [('code', 0, 9, '')] assert(format_for_telegram(test) == (formatted_body, styles)) test = """ @@ -30,17 +30,22 @@ def test_basic(): ``` """ formatted_body = '\n def test_basic():\n test = "_underline_"\n formatted_body = "underline"\n assert(format_for_telegram(test)[0] == formatted_body)\n' - styles = [('pre', 2, 149, 'python')] + styles = [('pre', 1, 150, 'python')] assert(format_for_telegram(test) == (formatted_body, styles)) test = "```\ncode block\n```" formatted_body = "code block" - styles = [('pre', 1, 9, '')] + styles = [('pre', 0, 10, '')] assert(format_for_telegram(test) == (formatted_body, styles)) test = "||this message contains a spoiler||" formatted_body = "this message contains a spoiler" - styles = [('spoiler', 1, 30, '')] + styles = [('spoiler', 0, 31, '')] + assert(format_for_telegram(test) == (formatted_body, styles)) + + test = "❤️💓💕💖💗 ||💙💚💛💜🖤|| 💝💞💟❣️" + formatted_body = "❤️💓💕💖💗 💙💚💛💜🖤 💝💞💟❣️" + styles = [('spoiler', 11, 10, '')] assert(format_for_telegram(test) == (formatted_body, styles)) def test_quotes(): |
