Skip to content

Commit 4bf395b

Browse files
committed
method for test empty matrix input
1 parent a9438d2 commit 4bf395b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/test/java/com/thealgorithms/matrix/MatrixMultiplicationTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ void testIncompatibleDimensions() {
5757
assertThrows(IllegalArgumentException.class, () -> MatrixMultiplication.multiply(A, B));
5858
}
5959

60+
@Test
61+
void testEmptyMatrices() {
62+
double[][] A = new double[0][0];
63+
double[][] B = new double[0][0];
64+
assertThrows(IllegalArgumentException.class, () -> MatrixMultiplication.multiply(A, B));
65+
}
66+
6067

6168
private void assertMatrixEquals(double[][] expected, double[][] actual) {
6269
assertEquals(expected.length, actual.length, "Row count mismatch");

0 commit comments

Comments
 (0)