Skip to content

Commit

Permalink
feat(tests): test Edmonds-Karp failure in sparse mode
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Sep 5, 2024
1 parent e99545d commit 2aa2326
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/edmondskarp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,24 @@ fn unknown_source() {
edmonds_karp_dense(&[1, 2, 3], &0, &3, Vec::<((i32, i32), i32)>::new());
}

#[test]
#[should_panic(expected = "source not found in vertices")]
fn unknown_source_2() {
edmonds_karp_sparse(&[1, 2, 3], &0, &3, Vec::<((i32, i32), i32)>::new());
}

#[test]
#[should_panic(expected = "sink not found in vertices")]
fn unknown_sink() {
edmonds_karp_dense(&[1, 2, 3], &1, &4, Vec::<((i32, i32), i32)>::new());
}

#[test]
#[should_panic(expected = "sink not found in vertices")]
fn unknown_sink_2() {
edmonds_karp_sparse(&[1, 2, 3], &1, &4, Vec::<((i32, i32), i32)>::new());
}

fn str_to_graph(desc: &str) -> (Vec<usize>, Vec<Edge<usize, isize>>) {
let vertices = (0..desc.lines().count() - 1).collect();
let edges = desc
Expand Down

0 comments on commit 2aa2326

Please sign in to comment.