added empty subsequence test to subs-only hnm_byteslike
This commit is contained in:
parent
f71d362807
commit
f48e3e7154
|
@ -27,6 +27,11 @@ substitutions_only_has_near_matches_byteslike(PyObject *self, PyObject *args)
|
|||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (subseq_len == 0) {
|
||||
PyErr_SetString(PyExc_ValueError, "Given subsequence is empty!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sub_counts = (unsigned int *) malloc (sizeof(unsigned int) * subseq_len);
|
||||
if (sub_counts == NULL) {
|
||||
return PyErr_NoMemory();
|
||||
|
|
|
@ -302,12 +302,10 @@ try:
|
|||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
class TestFindNearMatchesSubstitionsByteslike(
|
||||
class TestHasNearMatchesSubstitionsByteslike(
|
||||
TestHasNearMatchSubstitionsOnlyBase,
|
||||
unittest.TestCase
|
||||
):
|
||||
def search(self, subsequence, sequence, max_subs):
|
||||
return hnm_subs_byteslike(subsequence, sequence, max_subs)
|
||||
|
||||
def test_empty_subsequence_exeption(self):
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue