Exemplo n.º 1
0
 def testEscape(self):
     self.assertEqual(latex.escape('&'), '\&')
     self.assertEqual(latex.escape('%'), '\%')
     self.assertEqual(latex.escape('$'), '\$')
     self.assertEqual(latex.escape('#'), '\#')
     self.assertEqual(latex.escape('_'), '\_')
     self.assertEqual(latex.escape('{'), '\{')
     self.assertEqual(latex.escape('}'), '\}')
     self.assertEqual(latex.escape('^'), '\^')
     self.assertEqual(latex.escape('~'), '\\textasciitilde\\')
     self.assertEqual(latex.escape('\\'), '\\textbackslash\\')
     self.assertEqual(latex.escape('<'), '\\textless\\')
     self.assertEqual(latex.escape('>'), '\\textgreater\\')
Exemplo n.º 2
0
 def testEscape(self):
     self.assertEqual(latex.escape('&'), '\&')
     self.assertEqual(latex.escape('%'), '\%')
     self.assertEqual(latex.escape('$'), '\$')
     self.assertEqual(latex.escape('#'), '\#')
     self.assertEqual(latex.escape('_'), '\_')
     self.assertEqual(latex.escape('{'), '\{')
     self.assertEqual(latex.escape('}'), '\}')
     self.assertEqual(latex.escape('^'), '\^')
     self.assertEqual(latex.escape('~'), '\\textasciitilde\\')
     self.assertEqual(latex.escape('\\'), '\\textbackslash\\')
     self.assertEqual(latex.escape('<'), '\\textless\\')
     self.assertEqual(latex.escape('>'), '\\textgreater\\')