def test_08(self): self.assertEqual(quiz.constant_fold(('+', 'x', ('+', 'x', 'x'))), ('+', 'x', ('+', 'x', 'x')))
def test_06(self): self.assertEqual(quiz.constant_fold(('*', 'a', ('-', 'b', 0))), ('*', 'a', 'b'))
def test_07(self): self.assertEqual(quiz.constant_fold(('+', 1, ('*', 2, ('-', 3, 2)))), 3)
def test_05(self): self.assertEqual( quiz.constant_fold(('+', 7, ('*', 'x', ('-', 7, ('+', 4, 3))))), 7)
def test_04(self): self.assertEqual( quiz.constant_fold(('*', 1, ('+', 0, ('*', ('+', 'x', 0), 1)))), 'x')
def test_03(self): self.assertEqual( quiz.constant_fold(('+', 'a', ('+', ('*', 'b', 0), 'c'))), ('+', 'a', 'c'))
def test_02(self): self.assertEqual( quiz.constant_fold(('+', 'a', ('+', ('*', ('+', 3, 5), 6), 'b'))), ('+', 'a', ('+', 48, 'b')))
def test_01(self): self.assertEqual( quiz.constant_fold( ('+', 'a', ('+', 'b', ('+', ('+', 3, 5), 'c')))), ('+', 'a', ('+', 'b', ('+', 8, 'c'))))