# A set of function which exercise specific mutation operators. This
# is paired up with a test suite. The idea is that cosmic-ray should
# kill every mutant when that suite is run; if it doesn't, then we've
# got a problem.


def constant_number():
    return 42

def constant_true():
    return True


def constant_false():
    return False


def unary_sub():
    return -1


def unary_add():
    return +1


def equals(vals):
    def constraint(x, y):
        return (x == y) ^ (x != y)

    return all([constraint(x, y)
                for x in vals
                for y in vals])


def use_break(limit):
    for x in range(limit):
        break
    return x


def use_continue(limit):
    for x in range(limit):
        continue
    return x


def trigger_infinite_loop():
    # When `break` becomes `continue`, this should enter an infinite loop. This
    # helps us test timeouts.
    while True:
        break

# A set of function which exercise specific mutation operators. This
# is paired up with a test suite. The idea is that cosmic-ray should
# kill every mutant when that suite is run; if it doesn't, then we've
# got a problem.


def constant_number():
    return 42

def constant_true():
    return True


def constant_false():
    return False


def unary_sub():
    return -1


def unary_add():
    return +1


def equals(vals):
    def constraint(x, y):
        return (x == y) ^ (x != y)

    return all([constraint(x, y)
                for x in vals
                for y in vals])


def use_break(limit):
    for x in range(limit):
        break
    return x


def use_continue(limit):
    for x in range(limit):
        continue
    return x


def trigger_infinite_loop():
    # When `break` becomes `continue`, this should enter an infinite loop. This
    # helps us test timeouts.
    # Any object which isn't None passes the truth value testing so here
    # we use `while object()` instead of `while True` b/c the later becomes
    # `while False` when BooleanReplacer is applied and we don't trigger an
    # infinite loop.
    while object():
        break

Modify the infinite loop function
Modify the infinite loop function

Don't use `while True` b/c BooleanReplacer breaks this function's
test. This is a bit ugly but until Issue #97 is fixed there is
no other way around it.
