Skip to content

Commit d09bcf4

Browse files
authored
Remove path existence assertions from tests
Removed assertions for path existence in multiple tests.
1 parent 3d29f0d commit d09bcf4

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/test/java/com/thealgorithms/graph/BellmanFordTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ void testSimpleGraph() {
2828

2929
BellmanFord.Result result = BellmanFord.findShortestPaths(5, edges, 0);
3030

31-
assertTrue(result.hasPath());
3231
assertFalse(result.hasNegativeCycle());
3332
assertArrayEquals(new int[] {0, 2, 7, 4, -2}, result.getDistances());
3433
}
@@ -53,7 +52,6 @@ void testDisconnectedGraph() {
5352

5453
BellmanFord.Result result = BellmanFord.findShortestPaths(4, edges, 0);
5554

56-
assertTrue(result.hasPath());
5755
assertEquals(0, result.getDistance(0));
5856
assertEquals(5, result.getDistance(1));
5957
assertEquals(Integer.MAX_VALUE, result.getDistance(2));
@@ -65,7 +63,6 @@ void testSingleVertex() {
6563
List<BellmanFord.Edge> edges = new ArrayList<>();
6664
BellmanFord.Result result = BellmanFord.findShortestPaths(1, edges, 0);
6765

68-
assertTrue(result.hasPath());
6966
assertFalse(result.hasNegativeCycle());
7067
assertArrayEquals(new int[] {0}, result.getDistances());
7168
}
@@ -94,7 +91,6 @@ void testNegativeWeights() {
9491

9592
BellmanFord.Result result = BellmanFord.findShortestPaths(4, edges, 0);
9693

97-
assertTrue(result.hasPath());
9894
assertFalse(result.hasNegativeCycle());
9995
assertEquals(0, result.getDistance(0));
10096
assertEquals(5, result.getDistance(1));

0 commit comments

Comments
 (0)