MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / test_search

Function test_search

data_structures/linked_list/skip_list.py:302–315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

300
301
302def test_search():
303 skip_list = SkipList()
304
305 skip_list.insert("Key2", 20)
306 assert skip_list.find("Key2") == 20
307
308 skip_list.insert("Some Key", 10)
309 skip_list.insert("Key2", 8)
310 skip_list.insert("V", 13)
311
312 assert skip_list.find("Y") is None
313 assert skip_list.find("Key2") == 8
314 assert skip_list.find("Some Key") == 10
315 assert skip_list.find("V") == 13
316
317
318def test_deleting_item_from_empty_list_do_nothing():

Callers 1

pytestsFunction · 0.85

Calls 3

insertMethod · 0.95
findMethod · 0.95
SkipListClass · 0.85

Tested by

no test coverage detected