Skip to content

Commit

Permalink
TST: Add a few test cases for ANSI conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Feb 1, 2018
1 parent 5c18e5d commit 4bc6c2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nbconvert/filters/tests/test_ansi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def test_ansi2html(self):
'hel\x1b[0;32mlo': 'hel<span class="ansi-green-fg">lo</span>',
'hellø': 'hellø',
'\x1b[1mhello\x1b[33mworld\x1b[0m': '<span class="ansi-bold">hello</span><span class="ansi-yellow-intense-fg ansi-bold">world</span>',
'he\x1b[4mll\x1b[24mo': 'he<span class="ansi-underline">ll</span>o',
'\x1b[35mhe\x1b[7mll\x1b[27mo': '<span class="ansi-magenta-fg">he</span><span class="ansi-default-inverse-fg ansi-magenta-bg">ll</span><span class="ansi-magenta-fg">o</span>',
'\x1b[44mhe\x1b[7mll\x1b[27mo': '<span class="ansi-blue-bg">he</span><span class="ansi-blue-fg ansi-default-inverse-bg">ll</span><span class="ansi-blue-bg">o</span>',
}

for inval, outval in correct_outputs.items():
Expand All @@ -61,6 +64,7 @@ def test_ansi2latex(self):
'hello\x1b[01;34mthere': r'hello\textcolor{ansi-blue-intense}{\textbf{there}}',
'hello\x1b[001;34mthere': r'hello\textcolor{ansi-blue-intense}{\textbf{there}}',
'\x1b[1mhello\x1b[33mworld\x1b[0m': r'\textbf{hello}\textcolor{ansi-yellow-intense}{\textbf{world}}',
'he\x1b[4mll\x1b[24mo': 'he\\underline{ll}o',
}

for inval, outval in correct_outputs.items():
Expand Down

0 comments on commit 4bc6c2e

Please sign in to comment.