summaryrefslogtreecommitdiffstats
path: root/contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2025-09-11 19:12:15 +0300
committerrobot-piglet <[email protected]>2025-09-11 19:43:09 +0300
commit91708f49a58e3c0a1a3cf0a60c268c2d5b474a3e (patch)
tree9dbcd5cd1811b171ca7636600287d72327ef98ec /contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py
parentf4413504c29db8e1e7cce3a2103e89ecb4073271 (diff)
Intermediate changes
commit_hash:87ab6d7772f084decaa30c0cb439a3e0c000406e
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py')
-rw-r--r--contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py b/contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py
index 7d0e99a3350..3c692440143 100644
--- a/contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py
+++ b/contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py
@@ -91,3 +91,22 @@ def test_html_with_style():
f.data
== "\x1b[0m\x1b[?7h\x1b[0;32mhello\x1b[0m \x1b[0;1mworld\x1b[0m\r\n\x1b[0m"
)
+
+
[email protected](is_windows(), reason="Doesn't run on Windows yet.")
+def test_print_formatted_text_with_dim():
+ """
+ Test that dim formatting works correctly.
+ """
+ f = _Capture()
+ style = Style.from_dict(
+ {
+ "dimtext": "dim",
+ }
+ )
+ tokens = FormattedText([("class:dimtext", "dim text")])
+
+ pt_print(tokens, style=style, file=f, color_depth=ColorDepth.DEFAULT)
+
+ # Check that the ANSI dim escape code (ESC[2m) is in the output
+ assert "\x1b[0;2m" in f.data or "\x1b[2m" in f.data