summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Matusiak <numerodix@gmail.com>2021-05-05 11:10:22 +1000
committerMartin Matusiak <numerodix@gmail.com>2021-05-05 11:10:22 +1000
commitbb0e437db56823129de82e7d521f40959b0a5d86 (patch)
treeb41fa6f89aeee88e18ff4629facbce295b08abe8
parent300784cc2dd935e225b9b8f66f7d5f9b8b205ef5 (diff)
downloadansicolor-bb0e437db56823129de82e7d521f40959b0a5d86.tar.gz
add test for set_term_title
-rw-r--r--tests/test_colors.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_colors.py b/tests/test_colors.py
index bc95f71..0d16bfa 100644
--- a/tests/test_colors.py
+++ b/tests/test_colors.py
@@ -12,6 +12,7 @@ from ansicolor import strip_escapes
from ansicolor import wrap_string
from ansicolor import get_code_v2
from ansicolor import colorize_v2
+from ansicolor import set_term_title
import ansicolor
@@ -179,3 +180,10 @@ def test_justify_formatted():
assert justify_formatted(
red("hi"), rjust, 10
) == " " + red("hi")
+
+
+def test_set_term_title(capsys):
+ set_term_title('ansicolor demo')
+
+ captured = capsys.readouterr()
+ assert '\033]2;ansicolor demo\007' == captured.out \ No newline at end of file