def test_list1_longer(): list1 = LinkedList() list1.append(1) list1.append(2) list1.append(3) list2 = LinkedList() list2.append(4) list2.append(5) actual = str(zipLists(list1, list2)) expected = "{1}->{4}->{2}->{5}->{3}->NULL" assert actual == expected
def test_list1_shorter_plus(): list1 = LinkedList() list1.append(1) list1.append(2) list2 = LinkedList() list2.append(4) list2.append(5) list2.append(6) list2.append(7) list2.append(8) actual = str(zipLists(list1, list2)) expected = "{1}->{4}->{2}->{5}->{6}->{7}->{8}->NULL" assert actual == expected
def test_zipLists(): ll1 = Linked_list() for i in range(1, 5): ll1.append(i) ll2 = Linked_list() for i in range(5, 10): ll2.append(i) actual = zipLists(ll1, ll2) expected = '{1} -> {5} -> {2} -> {6} -> {3} -> {7} -> {4} -> {8} -> {9} -> None' assert actual == expected
def test_zipLists(): ll1 = LinkedList() ll2 = LinkedList() for i in range(1, 5): ll1.append(i) for i in range(5, 10): ll2.append(i) actual = zipLists(ll1, ll2) expected = '1 -> 5 -> 2 -> 6 -> 3 -> 7 -> 4 -> 8 -> 9 -> ' assert actual == expected