MCPcopy
hub / github.com/rapidfuzz/RapidFuzz / test_list_initialization

Function test_list_initialization

tests/distance/test_init.py:300–322  ·  view source on GitHub ↗

test whether list initialization works correctly

()

Source from the content-addressed store, hash-verified

298
299
300def test_list_initialization():
301 """
302 test whether list initialization works correctly
303 """
304 ops = Levenshtein.opcodes("aaabaaa", "abbaaabba")
305 ops2 = Opcodes(ops.as_list(), ops.src_len, ops.dest_len)
306 assert ops == ops2
307
308 ops = Levenshtein.editops("aaabaaa", "abbaaabba")
309 ops2 = Editops(ops.as_list(), ops.src_len, ops.dest_len)
310 assert ops == ops2
311
312 ops = Levenshtein.opcodes("aaabaaa", "abbaaabba")
313 ops2 = Editops(ops.as_list(), ops.src_len, ops.dest_len)
314 assert ops.as_editops() == ops2
315
316 ops = Levenshtein.editops("aaabaaa", "abbaaabba")
317 ops2 = Opcodes(ops.as_list(), ops.src_len, ops.dest_len)
318 assert ops.as_opcodes() == ops2
319
320 ops = Levenshtein.editops("skdsakldsakdlasda", "djkajkdfkdgkhdfjrmecsidjf")
321 ops2 = Opcodes(ops.as_list(), ops.src_len, ops.dest_len)
322 assert ops.as_opcodes() == ops2
323
324
325@pytest.mark.parametrize("module", [distance_py, distance_cpp])

Callers

nothing calls this directly

Calls 7

OpcodesClass · 0.90
EditopsClass · 0.90
opcodesMethod · 0.80
editopsMethod · 0.80
as_editopsMethod · 0.80
as_opcodesMethod · 0.80
as_listMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…