Files
boolean-tools/tests/test_walsh.py
T
2026-05-18 15:05:09 +02:00

12 lines
340 B
Python

from walsh.walsh import walsh_transform
def test_walsh_xor_two_variables():
assert walsh_transform("x1 XOR x2") == [0, 0, 0, 4]
def test_walsh_or_two_variables():
assert walsh_transform("x1 OR x2") == [-2, 2, 2, 2]
def test_walsh_xor_three_variables():
assert walsh_transform("x1 XOR x2 XOR x3") == [0, 0, 0, 0, 0, 0, 0, 8]