Esempio n. 1
0
 def test_InteriorNode_valueTest3(self):
     leaf1 = LeafNode(5)
     leaf2 = LeafNode(10)
     node1 = InteriorNode(Token('+'), leaf1, leaf2)
     node2 = InteriorNode(Token('*'), leaf1, node1)
     node3 = InteriorNode(Token('-'), node2, leaf2)
     self.assertEqual(node3.value(), 65)
Esempio n. 2
0
 def test_InteriorNode_valueTest1(self):
     leaf1 = LeafNode(5)
     leaf2 = LeafNode(10)
     node = InteriorNode(Token('+'), leaf1, leaf2)
     self.assertEqual(node.value(), 15)
Esempio n. 3
0
 def test_InteriorNode_valueTest2(self):
     leaf1 = LeafNode(5)
     leaf2 = LeafNode(10)
     node1 = InteriorNode(Token('+'), leaf1, leaf2)
     node2 = InteriorNode(Token('*'), leaf1, node1)
     self.assertEqual(node2.value(), 75)