Exemplo n.º 1
0
def test_unsparsify():
    # Test 2 overlapping dense needles:
    output = [[key_object_pair(KV1, 3, 7), key_object_pair(KV2, 5, None)],  # the overlap.
              [key_object_pair(KV2, 0, None)],  # just the second one,
              [key_object_pair(KV2, 0, 7)]]     # extending beyond the first

    list_eq(unsparsify(lambda: [NEEDLE1, NEEDLE2])(), output)
Exemplo n.º 2
0
def test_unsparsify_invalid():
    """Make sure unsparify raises ValueError on extents whose ends come before
    their starts."""
    raise SkipTest("At the moment, we tolerate these and simply warn. Once the clang compiler plugin doesn't spit these out anymore, return to raising an exception.")
    assert_raises(ValueError, unsparsify(lambda: [NEEDLE3]))
Exemplo n.º 3
0
def test_needle_smoke_test():
    list_eq(unsparsify(lambda: [])(), [])