""" Pygments Pango Markup formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments import highlight from pygments.formatters import PangoMarkupFormatter from pygments.lexers import JavascriptLexer INPUT = r""" function foobar(a, b) { if (a > b) { return a & b; } if (a < b) { return true; } console.log("single quote ' and double quote \"") console.log('single quote \' and double quote "') // comment with äöü ç } """ OUTPUT = r"""function foobar(a, b) { if (a > b) { return a & b; } if (a < b) { return true; } console.log("single quote ' and double quote \"") console.log('single quote \' and double quote "') // comment with äöü ç } """ def test_correct_output(): markup = highlight(INPUT, JavascriptLexer(), PangoMarkupFormatter()) assert OUTPUT == re.sub('', '', markup)