Skip to content

Commit 32dde85

Browse files
authored
Update NevilleTest.java
1 parent fd54a19 commit 32dde85

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/java/com/thealgorithms/maths/NevilleTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,12 @@ public void testEmptyArrays() {
5858
double target = 1;
5959
assertThrows(IllegalArgumentException.class, () -> Neville.interpolate(x, y, target));
6060
}
61+
62+
@Test
63+
public void testDuplicateXCoordinatesThrowsException() {
64+
double[] x = {1, 2, 1};
65+
double[] y = {5, 8, 3};
66+
double target = 1.5;
67+
assertThrows(IllegalArgumentException.class, () -> Neville.interpolate(x, y, target));
68+
}
6169
}

0 commit comments

Comments
 (0)