コード例 #1
0
	def test_process_rule_2 (self) :
		vertices = [Vertex() for _ in range(7)]
		l = ["5", "1", "1"]
		pfd_process_rule(l, vertices)
		self.assert_(vertices[5].numPred == 1)
		self.assert_(vertices[5].listPred == [1])
		self.assert_(vertices[1].listSuc == [5])
コード例 #2
0
	def test_process_rule_1 (self) :
		vertices = [Vertex() for _ in range(7)]
		l = ["3", "2", "1", "5"]
		pfd_process_rule(l, vertices)
		self.assert_(vertices[3].numPred == 2)
		self.assert_(vertices[3].listPred == [1, 5])
		self.assert_(vertices[1].listSuc == [3])
		self.assert_(vertices[5].listSuc == [3])
コード例 #3
0
	def test_process_rule_3 (self) :
		vertices = [Vertex() for _ in range(25)]
		l = ["3", "10", "1", "5", "6", "12", "2", "10", "8", "13", "16", "20"]
		pfd_process_rule(l, vertices)
		self.assert_(vertices[3].numPred == 10)
		self.assert_(vertices[3].listPred == [1, 5, 6, 12, 2, 10, 8, 13, 16, 20])
		self.assert_(vertices[1].listSuc == [3])
		self.assert_(vertices[5].listSuc == [3])
		self.assert_(vertices[6].listSuc == [3])
		self.assert_(vertices[12].listSuc == [3])
		self.assert_(vertices[2].listSuc == [3])
		self.assert_(vertices[10].listSuc == [3])
		self.assert_(vertices[8].listSuc == [3])
		self.assert_(vertices[13].listSuc == [3])
		self.assert_(vertices[16].listSuc == [3])
		self.assert_(vertices[20].listSuc == [3])