Skip to content

Commit

Permalink
add qf metadata validation to remove tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barrust committed Dec 20, 2024
1 parent 92d9984 commit dd80df4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/quotientfilter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def test_qf_remove_missing_elm(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, [])
self.assertTrue(qf.validate_metadata())

def test_qf_remove_cluster_start(self):
"""test removing a cluster start followed by empty"""
Expand All @@ -267,6 +268,7 @@ def test_qf_remove_cluster_start(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, ["."])
self.assertTrue(qf.validate_metadata())

def test_qf_remove_cluster_start_cluster(self):
"""test removing a cluster start followed by cluster start"""
Expand All @@ -282,6 +284,7 @@ def test_qf_remove_cluster_start_cluster(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, ["-"])
self.assertTrue(qf.validate_metadata())

def test_qf_remove_shifted_run_start_followed_by_empty(self):
"""test removing a shifted run start followed by empty"""
Expand All @@ -297,6 +300,7 @@ def test_qf_remove_shifted_run_start_followed_by_empty(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, ["z"])
self.assertTrue(qf.validate_metadata())

def test_qf_remove_shifted_run_start_followed_continuation(self):
"""test removing a shifted run start followed by continuation"""
Expand All @@ -312,6 +316,7 @@ def test_qf_remove_shifted_run_start_followed_continuation(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, ["y"])
self.assertTrue(qf.validate_metadata())

def test_qf_remove_shifted_continuation_followed_run_start(self):
"""test removing a shifted continuation followed by run start"""
Expand All @@ -327,6 +332,7 @@ def test_qf_remove_shifted_continuation_followed_run_start(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, ["x"])
self.assertTrue(qf.validate_metadata())

def test_qf_remove_shifted_run_start_followed_run_start(self):
"""test removing a shifted run start followed by run start"""
Expand All @@ -342,6 +348,7 @@ def test_qf_remove_shifted_run_start_followed_run_start(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, ["a"])
self.assertTrue(qf.validate_metadata())

def test_qf_remove_cluster_start_followed_continuation_follow_run_start(self):
"""test removing a cluster start followed by continuation putting a run start into a cluster start position"""
Expand All @@ -357,6 +364,7 @@ def test_qf_remove_cluster_start_followed_continuation_follow_run_start(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, ["d"])
self.assertTrue(qf.validate_metadata())

def test_qf_remove_full(self):
"""Test removing all elements, but find each one after each removal"""
Expand All @@ -379,6 +387,7 @@ def test_qf_remove_full(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, [])
self.assertTrue(qf.validate_metadata())

def test_qf_remove_full_random(self):
"""Test removing all elements, but in a random order"""
Expand All @@ -389,6 +398,7 @@ def test_qf_remove_full_random(self):

for l in alpha:
self.assertTrue(qf.check(l), "failed to insert")
self.assertTrue(qf.validate_metadata())

while alpha:
missing_vals = []
Expand All @@ -400,6 +410,7 @@ def test_qf_remove_full_random(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, [])
self.assertTrue(qf.validate_metadata())

def test_qf_remove_full_random_take_2(self):
"""Test removing all elements, but in a random order - take 2"""
Expand All @@ -421,3 +432,4 @@ def test_qf_remove_full_random_take_2(self):
if not qf.check(a):
missing_vals.append(a)
self.assertListEqual(missing_vals, [])
self.assertTrue(qf.validate_metadata())

0 comments on commit dd80df4

Please sign in to comment.