Ejemplo n.º 1
0
    def test_path_between_returns_True_only_if_there_exists_at_least_a_path_between_two_nodes_in_the_slice(
            self):
        my_slice = CFGSliceToSink(None, {1: [2, 3], 2: [4]})

        self.assertTrue(my_slice.path_between(1, 2))
        self.assertTrue(my_slice.path_between(1, 3))
        self.assertTrue(my_slice.path_between(2, 4))
        self.assertTrue(my_slice.path_between(1, 4))

        self.assertFalse(my_slice.path_between(3, 4))
Ejemplo n.º 2
0
    def test_path_between_deals_with_loops(self):
        my_slice = CFGSliceToSink(None, {1: [2, 3], 2: [1]})

        self.assertFalse(my_slice.path_between(1, 4))