def test_1_node_list(): node = Node(0) assert detect_cycle(node) == False
def test_2_node_list_with_no_cycle(): node6 = Node(6) node7 = Node(7, node6) assert detect_cycle(node7) == False
def test_5_node_list_input_with_cycle(): node1.successor = node5 assert detect_cycle(node5) == True
def test_2_node_list_with_cycle(): node1.successor = node2 assert detect_cycle(node2) == True
def test_5_node_list_input_with_no_cycle(): assert detect_cycle(node5) == False