def test_6(self): x = ['4', '+', [['3', '+', '1'], '!']] result = parse(x) self.assertEqual(result, [ '+', ['4', [], []], ['!', ['+', ['3', [], []], ['1', [], []]], []] ])
def testLongList(self): result = parse([['4', '+', '3'], '*', '7', '+', ['4', '+', [['3', '+', '1'], '!']]]) self.assertEqual(result, [ '+', ['*', ['+', ['4', [], []], ['3', [], []]], ['7', [], []]], [ '+', ['4', [], []], ['!', ['+', ['3', [], []], ['1', [], []]], []] ] ])
def testOne(self): result = parse(['1']) self.assertEqual(result, ['1', [], []])
def testEmpty(self): result = parse([]) self.assertEqual(result, [])
def testFactorial(self): result = parse(['2', '!']) self.assertEqual(result, ['!', ['2', [], []], []])
def test_1(self): x = [['4', '+', '3'], '*', '7'] result = parse(x) self.assertEqual( result, ['*', ['+', ['4', [], []], ['3', [], []]], ['7', [], []]])
def test_6(self): x = [['4'], '+', ['3'], '+', '6'] result = parse(x) self.assertEqual( result, ['+', ['+', ['4', [], []], ['3', [], []]], ['6', [], []]])
def test_3(self): x = ['3', '/', '6', '-', '9'] result = parse(x) self.assertEqual( result, ['-', ['/', ['3', [], []], ['6', [], []]], ['9', [], []]])
def test_2(self): x = ['2', '!'] result = parse(x) self.assertEqual(result, ['!', ['2', [], []], []])