15 lines
350 B
Python
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)
|