Skip to content

Commit 2aa2326

Browse files
committed
feat(tests): test Edmonds-Karp failure in sparse mode
1 parent e99545d commit 2aa2326

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/edmondskarp.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,24 @@ fn unknown_source() {
167167
edmonds_karp_dense(&[1, 2, 3], &0, &3, Vec::<((i32, i32), i32)>::new());
168168
}
169169

170+
#[test]
171+
#[should_panic(expected = "source not found in vertices")]
172+
fn unknown_source_2() {
173+
edmonds_karp_sparse(&[1, 2, 3], &0, &3, Vec::<((i32, i32), i32)>::new());
174+
}
175+
170176
#[test]
171177
#[should_panic(expected = "sink not found in vertices")]
172178
fn unknown_sink() {
173179
edmonds_karp_dense(&[1, 2, 3], &1, &4, Vec::<((i32, i32), i32)>::new());
174180
}
175181

182+
#[test]
183+
#[should_panic(expected = "sink not found in vertices")]
184+
fn unknown_sink_2() {
185+
edmonds_karp_sparse(&[1, 2, 3], &1, &4, Vec::<((i32, i32), i32)>::new());
186+
}
187+
176188
fn str_to_graph(desc: &str) -> (Vec<usize>, Vec<Edge<usize, isize>>) {
177189
let vertices = (0..desc.lines().count() - 1).collect();
178190
let edges = desc

0 commit comments

Comments
 (0)