MatrixMania/tests/test_transpose.py
2025-11-04 21:57:28 +01:00

12 lines
319 B
Python

import math, pytest
from matrixmania import transpose
def test_transpose_basic():
matrix = [[1, 2, 3], [4, 5, 6]]
expected = [[1, 4], [2, 5], [3, 6]]
assert transpose(matrix) == expected
def test_transpose_invalid():
matrix = [[1, 2], [3]]
with pytest.raises(ValueError):
transpose(matrix)