MatrixMania/tests/test_matmul.py
2025-11-02 22:46:11 +01:00

15 lines
350 B
Python

from matrixmania.compute import matmul, transpose
import pytest
def test_matmul_basic():
a = [[1, 2], [3, 4]]
b = [[2, 0], [1, 2]]
expected = [[4, 4], [10, 8]]
assert matmul(a, b) == expected
def test_matmul_invalid_dimensions():
a = [[1, 2, 3]]
b = [[1, 2], [3, 4]]
with pytest.raises(ValueError):
matmul(a, b)