def test_complex(self): self.assertEqual(splitParts('{{#if: {{{1}}} | {{lc:{{{1}}} | "parameter missing"}}'), ['{{#if: {{{1}}} ', ' {{lc:{{{1}}} ', ' "parameter missing"}}']) self.assertEqual(splitParts('''{{if:| |{{#if:the president| |{{#if:| [[Category:Hatnote templates|A{{PAGENAME}}]] }} }} }}'''), ['''{{if:| |{{#if:the president| |{{#if:| [[Category:Hatnote templates|A{{PAGENAME}}]] }} }} }}'''])
def test_simple(self): self.assertEqual(splitParts("p=q|q=r|r=s"), ['p=q', 'q=r', 'r=s'])