Esempio n. 1
0
 def test_replace_command_greedy_delim(self):
     a = 'tex text \\modul{10} text'
     result = ut.replace_command_greedy(a,
                                        'modul',
                                        '',
                                        False,
                                        "|",
                                        "|",
                                        rm_slash=True)
     self.assertEqual(result, 'tex text |10| text', msg=None)
Esempio n. 2
0
 def test_replace_command_greedy_space(self):
     a = 'tex text \\modul{10}text'
     result = ut.replace_command_greedy(a, 'modul', 'test', False)
     self.assertEqual(result, 'tex text \\test{10} text', msg=None)
Esempio n. 3
0
 def test_replace_command_greedy_multi(self):
     a = 'tex \\cmd{tex} text \\cmd{ok ok} text'
     result = ut.replace_command_greedy(a, 'cmd', 'command', False)
     self.assertEqual(result,
                      'tex \\command{tex} text \\command{ok ok} text')
Esempio n. 4
0
 def test_replace_command_greedy2(self):
     a = 'tex text \\command[option]{ok ok} text'
     result = ut.replace_command_greedy(a, 'command', 'cmd', True)
     self.assertEqual(result, 'tex text \\cmd text', msg=None)
Esempio n. 5
0
 def test_replace_command_greedy3(self):
     a = 'tex text \\command{ok ok} text'
     result = ut.replace_command_greedy(a, 'command', 'cmd', False)
     self.assertEqual(result, 'tex text \\cmd{ok ok} text', msg=None)
Esempio n. 6
0
 def test_replace_command_greedy_space(self):
     a = 'tex text \\modul{10}text'
     result = ut.replace_command_greedy(a, 'modul','test',False)
     self.assertEqual(result,
             'tex text \\test{10} text', msg=None)
Esempio n. 7
0
 def test_replace_command_greedy_delim(self):
     a = 'tex text \\modul{10} text'
     result = ut.replace_command_greedy(a, 'modul','',False,
                                        "|","|",rm_slash=True)
     self.assertEqual(result,
             'tex text |10| text', msg=None)
Esempio n. 8
0
 def test_replace_command_greedy_multi(self):
     a = 'tex \\cmd{tex} text \\cmd{ok ok} text'
     result = ut.replace_command_greedy(a, 'cmd','command',False)
     self.assertEqual(result,
             'tex \\command{tex} text \\command{ok ok} text')
Esempio n. 9
0
 def test_replace_command_greedy3(self):
     a = 'tex text \\command{ok ok} text'
     result = ut.replace_command_greedy(a, 'command','cmd',False)
     self.assertEqual(result,
             'tex text \\cmd{ok ok} text', msg=None)
Esempio n. 10
0
 def test_replace_command_greedy2(self):
     a = 'tex text \\command[option]{ok ok} text'
     result = ut.replace_command_greedy(a, 'command','cmd',True)
     self.assertEqual(result,
             'tex text \\cmd text', msg=None)