@@ -81,3 +81,17 @@ def test_filter_meta_equal(cc_txn_pair, key, value, expected_indexes):
postings = data.Posting.from_entries(cc_txn_pair)
actual = filters.filter_meta_equal(postings, key, value)
check_filter(actual, cc_txn_pair, expected_indexes)
@pytest.mark.parametrize('key,regexp,expected_indexes', [
('entity', '^Smith-', range(5)),
('receipt', r'\.pdf$', range(5)),
('receipt', 'Receipt', range(3)),
('statement', '.', [4]),
('metadate', 'foo', ()),
('BadKey', '.', ()),
('emptykey', '.', ()),
])
def test_filter_meta_match(cc_txn_pair, key, regexp, expected_indexes):
actual = filters.filter_meta_match(postings, key, regexp)