diff options
author | Ayowel <Ayowel@users.noreply.github.com> | 2022-11-01 21:22:49 +0100 |
---|---|---|
committer | Ayowel <Ayowel@users.noreply.github.com> | 2022-11-06 09:47:32 +0100 |
commit | e61134bb3a2a00dc133fc4fc91a2ba1dff8a336e (patch) | |
tree | 2cdd6e141d42f83d0b3abccce94a2413cb9c21b0 /tests | |
parent | 8371114d265fe0de654581398aae9f9e8a4a3c02 (diff) | |
download | pygments-git-e61134bb3a2a00dc133fc4fc91a2ba1dff8a336e.tar.gz |
Remove unneeded _format_unencoded_with_lineno function from IRCFormatter and fix line endings insertion
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_irc_formatter.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_irc_formatter.py b/tests/test_irc_formatter.py index bedef95d..c9301661 100644 --- a/tests/test_irc_formatter.py +++ b/tests/test_irc_formatter.py @@ -12,7 +12,7 @@ from pygments.lexers import PythonLexer from pygments.formatters import IRCFormatter tokensource = list(PythonLexer().get_tokens("lambda x: 123")) - +newlinetokensource = list(PythonLexer().get_tokens("from \\\n\\\n os import path\n")) def test_correct_output(): hfmt = IRCFormatter() @@ -20,3 +20,11 @@ def test_correct_output(): hfmt.format(tokensource, houtfile) assert '\x0302lambda\x03 x: \x0302123\x03\n' == houtfile.getvalue() + +def test_linecount_output(): + hfmt = IRCFormatter(linenos = True) + houtfile = StringIO() + hfmt.format(newlinetokensource, houtfile) + + expected_out = '0001: \x0302from\x03 \\\n0002: \\\n0003: \x1d\x0310os\x03\x1d \x0302import\x03 path\n0004: ' + assert expected_out == houtfile.getvalue() |