def test_includes(): ll = LinkedList() ll.insert('first') assert ll.includes("second") is False assert ll.includes("first") is True ll.insert("another") assert ll.includes("another") is True
def test_append_several(): ll = LinkedList() ll.append(1) ll.append(2) ll.append(3) assert ll.includes(3) assert str(ll) == '{ 1 } -> { 2 } -> { 3 } -> NULL'
def test_not_includes(): list = LinkedList() list.insert('rubber') list.insert('baby') list.insert('buggy') list.insert('bumpers') actual = list.includes('rad') expected = False assert actual == expected
def test_six(): ll1 = LinkedList() ll1.insert("a").insert("b").insert("c").insert("d") actual = ll1.includes("h") expected = False assert actual == expected
def test_five(): ll1 = LinkedList() ll1.insert("a").insert("b").insert("c").insert("d") actual = ll1.includes("c") expected = True assert actual == expected