def test_known_nullity(self): h = HeapCache() assert not h.is_nullity_known(1) assert not h.is_nullity_known(2) h.nullity_now_known(1) assert h.is_nullity_known(1) assert not h.is_nullity_known(2) h.reset() assert not h.is_nullity_known(1) assert not h.is_nullity_known(2)
def test_known_nullity_more_cases(self): h = HeapCache() box1 = RefFrontendOp(1) box2 = RefFrontendOp(2) h.class_now_known(box1) assert h.is_nullity_known(box1) h.new(box2) assert h.is_nullity_known(box2) h.reset() assert not h.is_nullity_known(box1) assert not h.is_nullity_known(box2)
def test_known_nullity(self): h = HeapCache() box1 = RefFrontendOp(1) box2 = RefFrontendOp(2) assert not h.is_nullity_known(box1) assert not h.is_nullity_known(box2) h.nullity_now_known(box1) assert h.is_nullity_known(box1) assert not h.is_nullity_known(box2) h.reset() assert not h.is_nullity_known(box1) assert not h.is_nullity_known(box2)