def test_filter_match(self):
    f = tracemalloc.Filter(True, 'abc')
    self.assertTrue(f._match_frame('abc', 0))
    self.assertTrue(f._match_frame('abc', 5))
    self.assertTrue(f._match_frame('abc', 10))
    self.assertFalse(f._match_frame('12356', 0))
    self.assertFalse(f._match_frame('12356', 5))
    self.assertFalse(f._match_frame('12356', 10))
    f = tracemalloc.Filter(False, 'abc')
    self.assertFalse(f._match_frame('abc', 0))
    self.assertFalse(f._match_frame('abc', 5))
    self.assertFalse(f._match_frame('abc', 10))
    self.assertTrue(f._match_frame('12356', 0))
    self.assertTrue(f._match_frame('12356', 5))
    self.assertTrue(f._match_frame('12356', 10))
    f = tracemalloc.Filter(True, 'abc', 5)
    self.assertFalse(f._match_frame('abc', 0))
    self.assertTrue(f._match_frame('abc', 5))
    self.assertFalse(f._match_frame('abc', 10))
    self.assertFalse(f._match_frame('12356', 0))
    self.assertFalse(f._match_frame('12356', 5))
    self.assertFalse(f._match_frame('12356', 10))
    f = tracemalloc.Filter(False, 'abc', 5)
    self.assertTrue(f._match_frame('abc', 0))
    self.assertFalse(f._match_frame('abc', 5))
    self.assertTrue(f._match_frame('abc', 10))
    self.assertTrue(f._match_frame('12356', 0))
    self.assertTrue(f._match_frame('12356', 5))
    self.assertTrue(f._match_frame('12356', 10))
    f = tracemalloc.Filter(True, 'abc', 0)
    self.assertTrue(f._match_frame('abc', 0))
    self.assertFalse(f._match_frame('abc', 5))
    self.assertFalse(f._match_frame('abc', 10))
    self.assertFalse(f._match_frame('12356', 0))
    self.assertFalse(f._match_frame('12356', 5))
    self.assertFalse(f._match_frame('12356', 10))
    f = tracemalloc.Filter(False, 'abc', 0)
    self.assertFalse(f._match_frame('abc', 0))
    self.assertTrue(f._match_frame('abc', 5))
    self.assertTrue(f._match_frame('abc', 10))
    self.assertTrue(f._match_frame('12356', 0))
    self.assertTrue(f._match_frame('12356', 5))
    self.assertTrue(f._match_frame('12356', 10))
def test_filter_match(self):
    f = tracemalloc.Filter(True, 'abc')
    self.assertTrue(f._match_frame('abc', 0))
    self.assertTrue(f._match_frame('abc', 5))
    self.assertTrue(f._match_frame('abc', 10))
    self.assertFalse(f._match_frame('12356', 0))
    self.assertFalse(f._match_frame('12356', 5))
    self.assertFalse(f._match_frame('12356', 10))
    f = tracemalloc.Filter(False, 'abc')
    self.assertFalse(f._match_frame('abc', 0))
    self.assertFalse(f._match_frame('abc', 5))
    self.assertFalse(f._match_frame('abc', 10))
    self.assertTrue(f._match_frame('12356', 0))
    self.assertTrue(f._match_frame('12356', 5))
    self.assertTrue(f._match_frame('12356', 10))
    f = tracemalloc.Filter(True, 'abc', 5)
    self.assertFalse(f._match_frame('abc', 0))
    self.assertTrue(f._match_frame('abc', 5))
    self.assertFalse(f._match_frame('abc', 10))
    self.assertFalse(f._match_frame('12356', 0))
    self.assertFalse(f._match_frame('12356', 5))
    self.assertFalse(f._match_frame('12356', 10))
    f = tracemalloc.Filter(False, 'abc', 5)
    self.assertTrue(f._match_frame('abc', 0))
    self.assertFalse(f._match_frame('abc', 5))
    self.assertTrue(f._match_frame('abc', 10))
    self.assertTrue(f._match_frame('12356', 0))
    self.assertTrue(f._match_frame('12356', 5))
    self.assertTrue(f._match_frame('12356', 10))
    f = tracemalloc.Filter(True, 'abc', 0)
    self.assertTrue(f._match_frame('abc', 0))
    self.assertFalse(f._match_frame('abc', 5))
    self.assertFalse(f._match_frame('abc', 10))
    self.assertFalse(f._match_frame('12356', 0))
    self.assertFalse(f._match_frame('12356', 5))
    self.assertFalse(f._match_frame('12356', 10))
    f = tracemalloc.Filter(False, 'abc', 0)
    self.assertFalse(f._match_frame('abc', 0))
    self.assertTrue(f._match_frame('abc', 5))
    self.assertTrue(f._match_frame('abc', 10))
    self.assertTrue(f._match_frame('12356', 0))
    self.assertTrue(f._match_frame('12356', 5))
    self.assertTrue(f._match_frame('12356', 10))