def test_linked_list_includes_value():
    """Test a linked list can be checked for the inclusion of a value."""

    value = 1
    linked_list = LinkedList()
    linked_list.insert(value)
    assert linked_list.includes(value)
예제 #2
0
def test_ll_includes_false():
    test = LinkedList()
    test.insert('Apple')
    expected = False
    actual = test.includes('Banana')
    assert actual == expected
예제 #3
0
def test_ll_includes_true():
    test = LinkedList()
    test.insert('Apple')
    assert test.includes('Apple')
예제 #4
0
def test_ll_insert_multiple():
    test = LinkedList()
    test.insert('Apple')
    test.insert('Cherry')
    assert test.includes('Apple')
    assert test.includes('Cherry')