mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Signed-off-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
17 lines
570 B
Python
17 lines
570 B
Python
"""Mutation teeth: each tempting caller->body flow must violate the theorem."""
|
|
from itertools import product
|
|
from fixed_payload import C, DOMAINS
|
|
|
|
caught = 0
|
|
for index in range(len(DOMAINS)):
|
|
violations = 0
|
|
for inputs in product(*DOMAINS):
|
|
mutated = C + b":" + inputs[index] # mutant copies one input category
|
|
if mutated != C:
|
|
violations += 1
|
|
assert violations
|
|
caught += 1
|
|
print(f"input category {index}: {violations} violations caught")
|
|
assert caught == len(DOMAINS)
|
|
print("RESULT: ALL NONINTERFERENCE MUTANTS CAUGHT")
|